> If there were a 'classonlymethod()' built-in, I'd probably use it, as I use > classmethods a fair bit (mostly for specialized constructors), but I don't > recall ever desiring to call one via an instance. Do you have an example > of the use cases you see? Not exactly, but I notice that e.g. UserList uses self.__class__ a lot; I think that's the kind of area where it might show up. > Hm. What if your PickyClassmethod were a built-in called 'constructor' or > 'factorymethod'? Probably too confining a name, if there are other uses > for class-only methods, I suppose. I'm not convinced that we have a problem (beyond Alex lying awake at night, that it :-). --Guido van Rossum (home page: http://www.python.org/~guido/)
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4