sgzwiz / brython

Automatically exported from code.google.com/p/brython
BSD 3-Clause "New" or "Revised" License
0 stars 1 forks source link

Static members are not attributes of class definition #90

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
class Stat:
  SMEMB = 1

assert Stat.SMEMB == 1
print('Ok')
What is the expected output? What do you see instead?
expected
Ok

instead:

RuntimeError: Stat.__getattr__(...) is undefined
module '__main__' line 4
assert Stat.SMEMB == 1

What version of the product are you using? On what operating system?
Brython version 1.1.20130227-112915
Linux Mint 14

Please provide any additional information below.
sometimes Stat.SMEMB <> Stat().SMEMB, since former is class variable and later 
instance variable

Original issue reported on code.google.com by ca...@nce.ufrj.br on 28 Feb 2013 at 11:42

GoogleCodeExporter commented 9 years ago
The same applies to inner classes

class Outer:
 class Inner:
  SMEMB = 1

assert Outer.Inner.SMEMB == 1
print('ok')

Original comment by ca...@nce.ufrj.br on 28 Feb 2013 at 11:54

GoogleCodeExporter commented 9 years ago
This issue was closed by revision r624.

Original comment by pierre.q...@gmail.com on 4 Mar 2013 at 10:28