-
-
Notifications
You must be signed in to change notification settings - Fork 405
Open
Labels
help wantedExtra attention is neededExtra attention is neededlevel:starterGood for newcomersGood for newcomersrule requestAdding a new ruleAdding a new rule
Description
Right now we can have two problems:
class Some(object):
for x in [1, 2]:
print(x)
print(Some.x) # oups, will show you `2`
and with modules:
# some.py
for x in [1, 2]:
print(x)
# __main__
import some
print(some.x) # 2
This is not users want in 99.9% of cases. There are other - functional - solutions which don't leave extra vars in the scope.
Moreover, for
is already forbidden in class bodies.
Metadata
Metadata
Assignees
Labels
help wantedExtra attention is neededExtra attention is neededlevel:starterGood for newcomersGood for newcomersrule requestAdding a new ruleAdding a new rule