Erik Max Francis wrote: > The negative integers are being descriminated against! I demand justice! > > def integers(): > yield 0 > x = 1 > while True: > yield x > yield -x > x += 1 > > ... which is also not a bad demonstration of how the integers are > countably infinite.
For some reason I was unable to avoid seeing that one can save a yield there (not that they're a scarce resource, mind you): def integers(): x = 0 while True: yield -x x += 1 yield x I know that shouldn't win any readability awards... -Peter -- http://mail.python.org/mailman/listinfo/python-list