In the following situations:
class Data(object):
@staticmethod
@property
def imagesTotal():
return 10
print(Data.imagesTotal)
The "print(Data.imagesTotal)" can't print "10", it print "<property object at
0x...>".
It might be a good idea to use "@staticproperty" to solve this problem.
"@staticproperty" is a decorators, it mix the @staticmethod and @property.
Then the static property has getter and setter.
_______________________________________________
Python-ideas mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at
https://mail.python.org/archives/list/[email protected]/message/DEC3AA2NN5KTI5LQ6M7FIRLPDYLNSP7G/
Code of Conduct: http://python.org/psf/codeofconduct/