Hello, On Sat, 19 Dec 2020 21:24:40 +0300 Paul Sokolovsky <pmis...@gmail.com> wrote:
> Hello, > > On Sat, 19 Dec 2020 03:52:46 +0100 > Marco Sulla <marco.sulla.pyt...@gmail.com> wrote: > > > Maybe it's a crazy idea, but what if we could decorate a single line > > of code? > > > For example: > > > > @Timer > > a = time_consuming_function() > > Syntax-wise, I don't see any problems. As I mentioned in a recent > mail, "@" here is effectively a prefix operator (unary in first > approximation). > > But is that really compelling usecase? What if you want to time 2 > statements? Thinking about it more, that would require introducing some kind of "brackets" to delimit "decorated" statements, e.g.: @Timer{ foo bar @} And then it's just one step more to switch to brace-based alternative syntax altogether. Recent (of gazillion older) motion on that front: https://github.com/umlet/pwk [] -- Best regards, Paul mailto:pmis...@gmail.com _______________________________________________ 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/YB6WACEHNXJIHNT5O3QROPT3F5D4Q2T7/ Code of Conduct: http://python.org/psf/codeofconduct/