summaryrefslogtreecommitdiff
path: root/test/input/func_noerror_decorator_scope.py
diff options
context:
space:
mode:
Diffstat (limited to 'test/input/func_noerror_decorator_scope.py')
-rw-r--r--test/input/func_noerror_decorator_scope.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/test/input/func_noerror_decorator_scope.py b/test/input/func_noerror_decorator_scope.py
new file mode 100644
index 0000000..1d21522
--- /dev/null
+++ b/test/input/func_noerror_decorator_scope.py
@@ -0,0 +1,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()