A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2005-May/053373.html below:

[Python-Dev] PEP 340 -- loose ends

[Python-Dev] PEP 340 -- loose ends [Python-Dev] PEP 340 -- loose endsGreg Ewing greg.ewing at canterbury.ac.nz
Thu May 5 06:33:03 CEST 2005
Shane Hathaway wrote:
> For each block statement, it is necessary to create a *new* iterator,
> since iterators that have stopped are required to stay stopped.  So at a
> minimum, used-defined statements will need to call something, and thus
> will have parentheses.

Not necessarily!

   class Frobbing:

     def __neg__(self):
       begin_frobbing()
       try:
         yield
       finally:
        end_frobbing()

   frobbing = Frobbing()

   ...

   -frobbing:
     do_something()

-- 
Greg Ewing, Computer Science Dept, +--------------------------------------+
University of Canterbury,	   | A citizen of NewZealandCorp, a	  |
Christchurch, New Zealand	   | wholly-owned subsidiary of USA Inc.  |
greg.ewing at canterbury.ac.nz	   +--------------------------------------+
More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4