Skip to content

Commit

Permalink
wip: added deadcode example
Browse files Browse the repository at this point in the history
  • Loading branch information
15r10nk committed Sep 27, 2022
1 parent 194bb60 commit 564c257
Show file tree
Hide file tree
Showing 4 changed files with 222 additions and 0 deletions.
78 changes: 78 additions & 0 deletions tests/sample_results/enum_init-py-2.7.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
[
[
"LOAD_GLOBAL",
"type"
],
[
"LOAD_FAST",
"other"
],
[
"CALL_FUNCTION",
"type(other)"
],
[
"LOAD_FAST",
"self"
],
[
"LOAD_ATTR",
"self.__class__"
],
[
"COMPARE_OP",
"type(other) is self.__class__"
],
[
"LOAD_FAST",
"self"
],
[
"LOAD_FAST",
"other"
],
[
"COMPARE_OP",
"self is other"
],
[
"LOAD_GLOBAL",
"NotImplemented"
],
[
"LOAD_GLOBAL",
"TypeError"
],
[
"LOAD_FAST",
"self"
],
[
"LOAD_ATTR",
"self.__class__"
],
[
"LOAD_ATTR",
"self.__class__.__name__"
],
[
"LOAD_FAST",
"other"
],
[
"LOAD_ATTR",
"other.__class__"
],
[
"LOAD_ATTR",
"other.__class__.__name__"
],
[
"BINARY_MODULO",
"\"unorderable types: %s() and %s()\" % (self.__class__.__name__, other.__class__.__name__)"
],
[
"CALL_FUNCTION",
"TypeError(\"unorderable types: %s() and %s()\" % (self.__class__.__name__, other.__class__.__name__))"
]
]
54 changes: 54 additions & 0 deletions tests/sample_results/enum_init-py-3.11.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
[
[
"CALL",
"class A:\n def __cmp__(self, other):\n if type(other) is self.__class__:\n if self is other:\n return 0\n return -1\n return NotImplemented\n raise TypeError(\"unorderable types: %s() and %s()\" % (self.__class__.__name__, other.__class__.__name__))"
],
[
"STORE_NAME",
"class A:\n def __cmp__(self, other):\n if type(other) is self.__class__:\n if self is other:\n return 0\n return -1\n return NotImplemented\n raise TypeError(\"unorderable types: %s() and %s()\" % (self.__class__.__name__, other.__class__.__name__))"
],
[
"STORE_NAME",
" def __cmp__(self, other):\n if type(other) is self.__class__:\n if self is other:\n return 0\n return -1\n return NotImplemented\n raise TypeError(\"unorderable types: %s() and %s()\" % (self.__class__.__name__, other.__class__.__name__))"
],
[
"LOAD_GLOBAL",
"type"
],
[
"LOAD_FAST",
"other"
],
[
"CALL",
"type(other)"
],
[
"LOAD_FAST",
"self"
],
[
"LOAD_ATTR",
"self.__class__"
],
[
"IS_OP",
"type(other) is self.__class__"
],
[
"LOAD_FAST",
"self"
],
[
"LOAD_FAST",
"other"
],
[
"IS_OP",
"self is other"
],
[
"LOAD_GLOBAL",
"NotImplemented"
]
]
82 changes: 82 additions & 0 deletions tests/sample_results/enum_init-py-3.5.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
[
[
"LOAD_GLOBAL",
"type"
],
[
"LOAD_FAST",
"other"
],
[
"CALL_FUNCTION",
"type(other)"
],
[
"LOAD_FAST",
"self"
],
[
"LOAD_ATTR",
"self.__class__"
],
[
"COMPARE_OP",
"type(other) is self.__class__"
],
[
"LOAD_FAST",
"self"
],
[
"LOAD_FAST",
"other"
],
[
"COMPARE_OP",
"self is other"
],
[
"UNARY_NEGATIVE",
"-1"
],
[
"LOAD_GLOBAL",
"NotImplemented"
],
[
"LOAD_GLOBAL",
"TypeError"
],
[
"LOAD_FAST",
"self"
],
[
"LOAD_ATTR",
"self.__class__"
],
[
"LOAD_ATTR",
"self.__class__.__name__"
],
[
"LOAD_FAST",
"other"
],
[
"LOAD_ATTR",
"other.__class__"
],
[
"LOAD_ATTR",
"other.__class__.__name__"
],
[
"BINARY_MODULO",
"\"unorderable types: %s() and %s()\" % (self.__class__.__name__, other.__class__.__name__)"
],
[
"CALL_FUNCTION",
"TypeError(\"unorderable types: %s() and %s()\" % (self.__class__.__name__, other.__class__.__name__))"
]
]
8 changes: 8 additions & 0 deletions tests/samples/enum_init.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
class A:
def __cmp__(self, other):
if type(other) is self.__class__:
if self is other:
return 0
return -1
return NotImplemented
raise TypeError("unorderable types: %s() and %s()" % (self.__class__.__name__, other.__class__.__name__))

0 comments on commit 564c257

Please sign in to comment.