Maybe it's a crazy idea, but what if we could decorate a single line
of code? For example:
@Timer
a = time_consuming_function()
This will be equivalent to using Steven's context manager, but the
decorator is more simple to comment and uncomment.
Maybe it could be possible to comment also code blocks:
@parallel
for x in y:
do_something(x)
now_something_completely_different(x)
This could be a shortcut for multiprocessing.
_______________________________________________
Python-ideas mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at
https://mail.python.org/archives/list/[email protected]/message/EQKDYPHSMEL6QO6DN4GQGJKHKOGUBMBJ/
Code of Conduct: http://python.org/psf/codeofconduct/