Re: [Python-Dev] Re: Re: anonymous blocks

2005-04-25 Thread Greg Ewing
Terry Reedy wrote: Not supporting iterables makes it harder to write a class which is inherently usable in a with block, though. The natural way to make iterable classes is to use 'yield' in the definition of __iter__ - if iter() is not called, then that trick can't be used. If you're defining i

Re: [Python-Dev] Re: Re: anonymous blocks

2005-04-21 Thread Samuele Pedroni
Fredrik Lundh wrote: Regardless, I believe that solving generator finalization (calling all enclosing finally blocks in the generator) is a worthwhile problem to solve. Whether that be by PEP 325, 288, 325+288, etc., that should be discussed. Whether people use it as a pseudo-block, or decide tha

Re: [Python-Dev] Re: Re: anonymous blocks

2005-04-21 Thread Guido van Rossum
[Brian Sabbey] > >> If suites were commonly used as above to define properties, event handlers > >> and other callbacks, then I think most people would be able to comprehend > >> what the first example above is doing much more quickly than the second. [Fredrik] > > wonderful logic, there. good lu

Re: [Python-Dev] Re: Re: anonymous blocks

2005-04-19 Thread Brian Sabbey
Fredrik Lundh wrote: Brian Sabbey wrote: If suites were commonly used as above to define properties, event handlers and other callbacks, then I think most people would be able to comprehend what the first example above is doing much more quickly than the second. wonderful logic, there. good luck