Yury, you are really the crazy hacker. Not sure tricks with patching bytecode etc are good for standard library.
On 2012-10-31, at 5:18 PM, Guido van Rossum <guido@python.org> wrote:FWIW, just a crazy comment: if we make @async decorator to clone
> @async
> def trivial(x):
> return x
> yield # Unreachable, but makes it a generator
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@python.org
http://mail.python.org/mailman/listinfo/python-ideas