Skip to content

Commit c9afd2a

Browse files
refactor
1 parent 8e7a55b commit c9afd2a

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

mypyc/codegen/emit.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1238,13 +1238,11 @@ def c_array_initializer(components: list[str], *, indented: bool = False) -> str
12381238
return "{\n " + ",\n ".join(res) + "\n" + indent + "}"
12391239

12401240

1241-
class _mypyc_safe_key(pprint._safe_key): # type: ignore [name-defined, misc]
1241+
def _mypyc_safe_key(obj: object) -> str:
12421242
"""A custom sort key implementation for pprint that makes the output deterministic
12431243
for all literal types supported by mypyc.
12441244
12451245
This is NOT safe for use as a sort key for other types, so we MUST replace the
12461246
original pprint._safe_key once we've pprinted our object.
12471247
"""
1248-
1249-
def __lt__(self, other: _mypyc_safe_key) -> bool:
1250-
return str(type(self.obj)) + repr(self.obj) < str(type(other.obj)) + repr(other.obj)
1248+
return str(type(obj)) + repr(obj)

0 commit comments

Comments
 (0)