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

php - How to pass multiple values from url -

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

database - php search bar when I press submit with nothing in the search bar it shows all the data -