Commit 38aca14c authored by Stefan Behnel's avatar Stefan Behnel

tests for class scope behaviour

parent 368ddfc3
......@@ -18,6 +18,8 @@ genexpr_iterable_lookup_T600
for_from_pyvar_loop_T601
decorators_T593
temp_sideeffects_T654
class_scope_T671
class_scope_del_T684
# CPython regression tests that don't current work:
pyregr.test_threadsignals
......
# mode:run
# tag: class, scope
class MethodRedef(object):
"""
>>> MethodRedef().a(5)
7
"""
def a(self, i):
return i+1
def a(self, i):
return i+2
# mode:run
# tag: class, scope
# ticket: 671
MAIN = True
class OuterScopeLookup(object):
"""
>>> OuterScopeLookup.MAIN
True
"""
MAIN = MAIN # looked up in parent scope, assigned to class scope
# mode:run
# tag: class, scope, del
# ticket: 684
class DelInClass(object):
"""
>>> DelInClass.y
5
>>> DelInClass.x
Traceback (most recent call last):
AttributeError: type object 'DelInClass' has no attribute 'x'
"""
x = 5
y = x
del x
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment