[Python-ideas] Re: Add a decorators called @staticproperty

2021-12-19 Thread Serhiy Storchaka
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

[Python-ideas] staticmethod vs classmethod [was: Add a decorators called @staticproperty]

2021-12-19 Thread 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 only one > specific case). What is the on

[Python-ideas] Re: staticmethod vs classmethod [was: Add a decorators called @staticproperty]

2021-12-19 Thread Serhiy Storchaka
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

[Python-ideas] Re: Add a decorators called @staticproperty

2021-12-19 Thread Christopher Barker
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