Message364776
While the current behavior may be initially unexpected, it does match the way that python normally behaves when defining class variables. For example, the following class will throw an exception because the function number_two() is called before it is defined:
class Numbers:
one = 1
two = number_two()
def number_two():
return 2
# NameError: name 'number_two' is not defined
However, this version is fine:
class Numbers:
one = 1
def number_two():
return 2
two = number_two() |
|
Date |
User |
Action |
Args |
2020-03-21 21:45:08 | Jonathan Hsu | set | recipients:
+ Jonathan Hsu, barry, eli.bendersky, docs@python, ethan.furman, edd07, Ethan Onstott |
2020-03-21 21:45:08 | Jonathan Hsu | set | messageid: <1584827108.9.0.302452692651.issue40025@roundup.psfhosted.org> |
2020-03-21 21:45:08 | Jonathan Hsu | link | issue40025 messages |
2020-03-21 21:45:08 | Jonathan Hsu | create | |
|