18 Dec
2021
18 Dec
'21
3:18 a.m.
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.