Randolf Scholz <randolf.sch...@gmail.com> added the comment:

@Alex Regarding my proposal, the crucial part is the desiderata, not the hacked 
up implementation I presented.

And I really believe that at least that part I got hopefully right. After all, 
what does `@classmethod` functionally do? It makes the first argument of the 
function receive the class type instead of the object instance and makes it 
possible to call it directly from the class without instantiating it. I would 
still expect `MyClass.__dict__["themethod"]` to behave, as an object, much the 
same, regardless if it was decorated with `@classmethod` or not.

Regarding code breakage - yes that is a problem, but code is already broken and 
imo Python needs to make a big decision going forward: 

1. Embrace decorator chaining and try hard to make it work universally (which 
afaik was never intended originally when decorators were first introduced). As 
a mathematician I would love this, also adding `@` as a general purpose 
function composition operator would add quite some useful functional 
programming aspects to python.
2. Revert changes from 3.9 and generally discourage decorator chaining.

At this point however I want to emphasize that I am neither a CS major nor a 
python expert (I only started working with the language 3 years ago), so take 
everything I say as what it is - the opinion of some random stranger from the 
internet (:

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue45356>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to