Reputation: 4008
I have 3 classes A,B,C , C inherting form A and B:
class A:
a = "ala"
class B:
b = "bla"
class C(A,B):
c = "cla"
How can I get only the Attributes of C, attributes that are not inherited ?
Upvotes: 0
Views: 45
Reputation: 78690
You could access the __dict__
of C
directly via the vars
builtin.
>>> vars(C)['c']
'cla'
>>> vars(C)['b']
...
KeyError: 'b'
There's not much more to say without further context about what your real problem is.
Upvotes: 2