18.12.21 13:18, [email protected] пише:
> 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.
classmethod supersedes staticmethod. It was not clearly kno
On 12/19/21 5:40 AM, Serhiy Storchaka wrote:
> classmethod supersedes staticmethod. It was not clearly known when they
> were introduced, but now we see that there is very few use cases for
> staticmethod which cannot be replaced by classmethod (actually only one
> specific case).
What is the on
19.12.21 19:41, Ethan Furman пише:
> On 12/19/21 5:40 AM, Serhiy Storchaka wrote:
>
>> classmethod supersedes staticmethod. It was not clearly known when they
>> were introduced, but now we see that there is very few use cases for
>> staticmethod which cannot be replaced by classmethod (actually o
On Sun, Dec 19, 2021 at 5:41 AM Serhiy Storchaka
wrote:
So you can use a combination of @classmethod and @property.
>
> class Data:
> @classmethod
> @property
> def imagesTotal(cls):
> return 10
And this would be more useful anyway: if you want a class property, it may
well