Feb-04-2018, 04:46 PM
What is your actual purpose on doing this determines the result.
From the object of the class
From the object of the class
>>> class Klass: ... def __init__(self): ... self.var = 1 ... self.pot = 'test' ... >>> obj = Klass() >>> obj.__dict__ {'var': 1, 'pot': 'test'}
Recommended Tutorials: