[Python-Dev] Proposed changes to PEP 343 (original) (raw)
Michael Hudson mwh at python.net
Fri Oct 7 15:02:12 CEST 2005
- Previous message: [Python-Dev] Proposed changes to PEP 343
- Next message: [Python-Dev] Proposed changes to PEP 343
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Nick Coghlan <ncoghlan at gmail.com> writes:
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.What if we simply special-cased the with slot in type(), such that if it is populated with a generator object, that object is automatically wrapped using the @contextmanager decorator? (Jason actually suggested this idea previously)
Seems a bit magical to me, but haven't thought about it hard.
Cheers, mwh
-- I think my standards have lowered enough that now I think ``good design'' is when the page doesn't irritate the living fuck out of me. -- http://www.jwz.org/gruntle/design.html
- Previous message: [Python-Dev] Proposed changes to PEP 343
- Next message: [Python-Dev] Proposed changes to PEP 343
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]