Python 3.5 abc.py bug distilled

This commit is contained in:
rocky
2016-05-05 04:11:53 -04:00
parent 6765a2ea97
commit 05733c6171
5 changed files with 21 additions and 1 deletions

View File

@@ -0,0 +1,14 @@
# Python3.5 bug from abc.py:
# stmt ::= LOAD_CLOSURE RETURN_VALUE RETURN_LAST
#
# And this gets ignored.
# Note this is similar to 06_classbug.py but not the same.
# classmethod -> object
class abstractclassmethod(classmethod):
__isabstractmethod__ = True
def __init__(self, callable):
callable.__isabstractmethod__ = True
super().__init__(callable)

View File

@@ -5,6 +5,9 @@
# LOAD_FAST '__locals__'
# STORE_LOCALS ''
# Note this is similar to 05_abc_class.py but not the same:
# object -> classmethod
class abstractclassmethod(object):
"""A Python 3.2 STORE_LOCALS bug
"""