[Python-Dev] PEP 340 -- concept clarification

Phillip J. Eby pje at telecommunity.com
Wed May 4 01:36:47 CEST 2005


At 07:27 PM 5/3/05 -0400, Phillip J. Eby wrote:
>Modifying the spec is potentially more controversial, however; it'll have
>to go past the Web-SIG, and I assume the first thing that'll be asked is,
>"Why aren't generators getting a close() method then?", so I figured I
>should ask that question first.

You know what, never mind.  I'm still going to write the Web-SIG so they 
know the change is coming, but this is really a very minor thing; just a 
feature we won't get "for free" as a side effect of PEP 325.

Your decorator idea is a trivial solution, but it would also be trivial to 
allow WSGI server implementations to call __exit__ on generators.  None of 
this affects existing code in the field, because today you can't write a 
try/finally in a generator anyway.  Therefore, nobody is relying on this 
feature, therefore it's basically moot.



More information about the Python-Dev mailing list