How to get user-defined class attributes from class instance? I tried this:
class A:
FOO = 'foo'
BAR = 'bar'
a = A()
print(a.__dict__) # {}
print(vars(a)) # {}
I use python 3.5.
Is there a way to get them?
I know that dir(a)
returns a list with names of attributes, but I need only used defined, and as a dict name to value.