>>> First line of the body vs line before the declaration doesn't feel
>>> like it makes much difference to me.

Usually, decorators or annotations are placed near the method signature, that 
is, at the beginning where any reading begins, because it's easier to see that 
method is deprecated or anything else that needs a decorator.

Putting this information inside the method body, you end up putting information 
that is not the method's responsibility to provide, this ends up mixing with 
what the method actually does, it's more information to read in a debug or in 
maintenance that the method will need to receive. Not to mention the fact that 
sometimes depreciation messages can be longer than 2 lines.

Most programming languages ​​have some way of expressing depreciation, and it's 
usually close to the method signature.

I'm not proposing to do away with the way it is done today, but rather to 
expand the possibilities. There are times when the existence of just one 
decorator would make the code cleaner than inserting more information into the 
body of the method/function.

Ps.: Relax Paul, you don't need to be afraid, this is just a proposal.

Thanks for the contribution, good points raised.
_______________________________________________
Python-ideas mailing list -- python-ideas@python.org
To unsubscribe send an email to python-ideas-le...@python.org
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at 
https://mail.python.org/archives/list/python-ideas@python.org/message/R4OS67MVBS6FYBGFTSEDFFC5NGCXLAQ3/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to