fix usage of eval(repr(Editop)) and eval(repr(Opcode))

This commit is contained in:
Max Bachmann 2022-07-21 21:45:51 +02:00
parent 7989c67ed7
commit f1f840bbe5
2 changed files with 5 additions and 2 deletions

View File

@ -4,6 +4,9 @@
#### Changed
- merge adjacent similar blocks in `rapidfuzz.distance.Opcodes`
#### Fixed
- fix usage of `eval(repr(Editop))` and `eval(repr(Opcode))`
### [2.2.0] - 2022-07-19
#### Changed
- added in-tree build backend to install cmake and ninja only when it is not installed yet

View File

@ -211,7 +211,7 @@ cdef class Editop:
raise IndexError('Editop index out of range')
def __repr__(self):
return f"Editop(tag={self.tag}, src_pos={self.src_pos}, dest_pos={self.dest_pos})"
return f"Editop(tag='{self.tag}', src_pos={self.src_pos}, dest_pos={self.dest_pos})"
cdef class Editops:
"""
@ -408,7 +408,7 @@ cdef class Opcode:
raise IndexError('Opcode index out of range')
def __repr__(self):
return f"Opcode(tag={self.tag}, src_start={self.src_start}, src_end={self.src_end}, dest_start={self.dest_start}, dest_end={self.dest_end})"
return f"Opcode(tag='{self.tag}', src_start={self.src_start}, src_end={self.src_end}, dest_start={self.dest_start}, dest_end={self.dest_end})"
cdef class Opcodes:
"""