Access from class variable to one on constructor

Kless jonas.esp at googlemail.com
Mon Feb 23 04:40:47 EST 2009


How to access from a class variable to one that is initialized on the
constructor?
--------------
class Foo():
  foo = bar  # I want to access *from here* to variables created on
the constructor.

  def __init__(self, bar_init):
    self.bar = bar_init
--------------

Note: I've to create a subclass where the parent class to get
variables using *for i in dir(self): * so it doesn't get variables
initialized on the constructor.



More information about the Python-list mailing list