Pierre Quentel wrote:
> With the proposed Range class, here is an implementation of the Fibonacci
> sequence, limited to 2000 :
>
> previous = 0
> def fibo(last):
> global previous
> _next, previous = previous+last, last
> return _next
>
> print(list(Range(1, 2000, fibo)))
How would you make
print(list(Range(1000, 2000, fibo)))
work?
Without that and with the `previous` global under the rug that doesn't
look range-like.
_______________________________________________
Python-ideas mailing list
Python-ideas@python.org
https://mail.python.org/mailman/listinfo/python-ideas
Code of Conduct: http://python.org/psf/codeofconduct/