[Python-Dev] 'With' context documentation draft (was Re: Terminology for PEP 343

Nicolas Fleury nidoizo at yahoo.com
Thu Jul 7 03:17:11 CEST 2005


Fred L. Drake, Jr. wrote:
> On Wednesday 06 July 2005 19:47, Raymond Hettinger wrote:
>  > These names should be changed to __beginwith__ and __endwith__.  The
>  > current names are too vague, not obviously paired with each other, not
>  > obviously tied to the with-statement, and provide no hint about what
>  > calls them.  Remember, the methods will appear among a slew of other
>  > methods that have nothing to do with with-statements.  There will be no
>  > surrounding contextual clue as to what these methods are for.
> 
> I don't really like this; what's to say there won't be some other client of 
> the context protocol?  Should __iter__ have been __iterfor__?  (I don't think 
> so.)

Then what about __begincontext__ and __endcontext__?  Raymond's points 
about __enter__ and __exit__ are still good.

Regards,
Nicolas



More information about the Python-Dev mailing list