blob: 1d21522f4a50b18850cd6f9507833d9fa4f452f6 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
|
"""Test that decorators sees the class namespace - just like
function default values does but function body doesn't.
https://www.logilab.net/elo/ticket/3711 - bug finding decorator arguments
https://www.logilab.net/elo/ticket/5626 - name resolution bug inside classes
"""
class Test:
ident = lambda x: x
@ident(ident)
def f(self, val=ident(7), f=ident):
return f(val)
print Test().f()
|