A RetroSearch Logo

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

Search Query:

Showing content from http://mail.python.org/pipermail/python-dev/1999-July/000501.html below:

[Python-Dev] Generator details

[Python-Dev] Generator details [Python-Dev] Generator detailsBarry A. Warsaw bwarsaw@cnri.reston.va.us (Barry A. Warsaw)
Mon, 12 Jul 1999 11:42:14 -0400 (EDT)
    |     value, frame = generator(args)
    |     try:
    |         while frame:
    |             etc
    |                 value, frame = resume_frame(frame)
    |     finally:
    |         if frame:
    |              shut_frame_down(frame)

Minor point, but why not make resume() and shutdown() methods on the
frame?  Isn't this much cleaner?

    value, frame = generator(args)
    try:
	while frame:
	    etc
	    value, frame = frame.resume()
    finally:
	if frame:
	    frame.shutdown()

-Barry



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