mirror of
https://github.com/rocky/python-uncompyle6.git
synced 2024-11-26 22:50:40 +00:00
Test for class decorator
See https://github.com/rocky/python-uncompyle6/pull/15
This commit is contained in:
parent
cce40bef21
commit
e1a2860013
BIN
test/bytecode_2.7/10_classdec.pyc
Normal file
BIN
test/bytecode_2.7/10_classdec.pyc
Normal file
Binary file not shown.
27
test/simple_source/def/10_classdec.py
Normal file
27
test/simple_source/def/10_classdec.py
Normal file
@ -0,0 +1,27 @@
|
||||
#!/usr/bin/env python
|
||||
# See https://github.com/rocky/python-uncompyle6/pull/15
|
||||
|
||||
# In Python 2.7, you should see
|
||||
# mkfuncdeco0 ::= mkfunc
|
||||
# classdefdeco2 ::= LOAD_CONST expr mkfunc CALL_FUNCTION_0 BUILD_CLASS
|
||||
# classdefdeco1 ::= expr classdefdeco1 CALL_FUNCTION_1
|
||||
# designator ::= STORE_NAME
|
||||
# classdefdeco ::= classdefdeco1 designator
|
||||
|
||||
def author(*author_names):
|
||||
def author_func(cls):
|
||||
return cls
|
||||
return author_func
|
||||
|
||||
@author('Me', 'Him')
|
||||
@author('You')
|
||||
class MyClass(object):
|
||||
def __init__(self):
|
||||
pass
|
||||
|
||||
@staticmethod
|
||||
@staticmethod
|
||||
def static_method():
|
||||
pass
|
||||
|
||||
x = MyClass()
|
Loading…
Reference in New Issue
Block a user