python - How to get the class name of a staticmethod -



python - How to get the class name of a staticmethod -

so there static method in base of operations class, , sub classes should utilize it.

however, need know sub class calls static method.

the code this:

class baseclass(): @staticmethod def getname(): #some magic class subclassa(baseclass): pass class subclassb(baseclass): pass subclassa.getname() #hope see 'subclassa' subclassb.getname() #hope see 'subclassb'

or, possible?

not possible staticmethod. possible, however, classmethod

class a(object): @classmethod def f(cls): print cls

python static-methods

Comments

Popular posts from this blog

xslt - DocBook 5 to PDF transform failing with error: "fo:flow" is missing child elements. Required content model: marker* -

mediawiki - How do I insert tables inside infoboxes on Wikia pages? -

Local Service User Logged into Windows -