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/2001-June/015456.html below:

[Python-Dev] Re: PEP 255: Simple Generators

[Python-Dev] Re: PEP 255: Simple GeneratorsGreg Ewing see@my.signature
Tue, 19 Jun 2001 18:21:14 +1200
Something is bothering me about this. In fact,
it's bothering me a LOT. In the following, will
f() work as a generator-function:

  def f():
    for i in range(5):
      g(i)

  def g(i):
    for j in range(10):
      yield i,j

If I understand PEP255 correctly, this will *not*
work. But it seems entirely reasonable to me that
it *should* work. It *has* to work, otherwise how
am I to write generators that are too complicated
to fit into a single function?

Someone please tell me I'm wrong about this!
 
-- 
Greg Ewing, Computer Science Dept, University of Canterbury,	  
Christchurch, New Zealand
To get my email address, please visit my web page:	  
http://www.cosc.canterbury.ac.nz/~greg



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