I want to do something in a base class (FooBase) with the class attribues of the derived classes (Foo). I want to do this with Python3.
class BaseFoo:
#felder = [] doesn't work
def test():
print(__class__.felder)
class Foo(BaseFoo):
felder = ['eins', 'zwei', 'yep']
if __name__ == '__main__':
Foo.test()
Maybe there is a different approach to this?
testsupposed to be a class method or an instance method? It must at the very least accept eitherclsorselfas argument.