[Python-ideas] Async API: some code to review
Andrew Svetlov
andrew.svetlov at gmail.com
Wed Oct 31 22:34:02 CET 2012
Yury, you are really the crazy hacker. Not sure tricks with patching
bytecode etc are good for standard library.
On Wed, Oct 31, 2012 at 11:31 PM, Yury Selivanov <yselivanov.ml at gmail.com>wrote:
> On 2012-10-31, at 5:18 PM, Guido van Rossum <guido at python.org> wrote:
>
> > @async
> > def trivial(x):
> > return x
> > yield # Unreachable, but makes it a generator
>
> FWIW, just a crazy comment: if we make @async decorator to clone
> the code object of a passed function and set its (co_flags | 0x0020),
> then any passed function becomes a generator, even if it doesn't
> have yields/yield-froms ;)
>
> -
> Yury
> _______________________________________________
> Python-ideas mailing list
> Python-ideas at python.org
> http://mail.python.org/mailman/listinfo/python-ideas
>
--
Thanks,
Andrew Svetlov
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20121031/a6cf5850/attachment.html>
More information about the Python-ideas
mailing list