Wednesday 15 January 2014

Calling @classmethod of abstract super class error -- Python -



Calling @classmethod of abstract super class error -- Python -

i trying overwrite classmethod seen in code below getting next error

typeerror: must type, not classobj

why happening, , how can prepare it?

class a(object): @classmethod def test(cls, data): pass class b(a): @classmethod def test(cls, data): pass class c(b): @classmethod def test(cls, data): # info homecoming super(b, cls).test(data)

super works new-style classes (which in 2.x series means inheriting object), a old-style class.

to prepare it, replace class a(): class a(object):.

python

No comments:

Post a Comment