Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I would like to get list of Python class properties. So I could make base class with function to get dict with all class properties name and value but without specifying exact properties.

share|improve this question

closed as off topic by Stefano Palazzo Jan 11 '12 at 12:58

Questions on Ask Ubuntu are expected to relate to Ubuntu within the scope defined by the community. Consider editing the question or leaving comments for improvement if you believe the question can be reworded to fit within the scope. Read more about reopening questions here.If this question can be reworded to fit the rules in the help center, please edit the question.

Possibly this would be better located at StackOverflow? – Christopher Kyle Horton Jan 11 '12 at 8:45
You can have your class inherit from UserDict and subclass it that way: By the way, this is the wrong site for such questions. Like Warrioring says, you should ask on Stack Overflow next time. – Stefano Palazzo Jan 11 '12 at 12:58
Thank You ...and sorry. – marcinpz Jan 11 '12 at 14:01
properties = some_class.__dict__

## for example,

a = str.__dict__
b = int.__dict__
share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.