Michael Hudson wrote:
> <nit>
> You don't want to check if it's a generator, you want to check if it's
> a function whose func_code has the relavent bit set.
> </nit>
Fair point :)
> Seems a bit magical to me, but haven't thought about it hard.
Same here - I'm just starting to think that the alternative is worse, because
it leaves open the nonsensical possibility of writing a __with__ method as a
generator *without* applying the contextmanager decorator, and that would just
be bizarre - if you want to get an iterable, why aren't you writing an
__iter__ method instead?
Cheers,
Nick.
--
Nick Coghlan | [EMAIL PROTECTED] | Brisbane, Australia
---------------------------------------------------------------
http://boredomandlaziness.blogspot.com
_______________________________________________
Python-Dev mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com