2.2 features

Jeff Shannon jeff at ccvcorp.com
Wed Jul 25 18:15:04 EDT 2001


David Bolen wrote:

> Jeff Shannon <jeff at ccvcorp.com> writes:
>
> > Haven't looked into this in detail, or even downloaded 2.2 yet, but...
>
> It's sort of noticeable from the question :-)
>
> > couldn't that be written as:
> >
> > if __name__ == '__main__':
> >     for i in fib():
> >         print i,
> >
> > ???
>
> Only if fib() was going to return the entire list of numbers in the
> sequence as an already created list object.  But fibonacci numbers are
> an infinite sequence, so clearly you can't do that.  Or you'd have to
> artifically terminate it somewhere.
>

Hey, the specification never said anything about needing to *stop* ....  ;)

Jeff Shannon
Technician/Programmer
Credit International




More information about the Python-list mailing list