Paul Rubin <http://[EMAIL PROTECTED]> writes:
> Tim Peters <[EMAIL PROTECTED]> writes: > > The GIL is your friend here: > > > > import itertools > > f = itertools.count().next > > Thanks, I was hoping something like this would work but was not sure I > could rely on it. > > > A similar thing can be done with xrange. But either way sucks if you > > call it often enough to exceed the size of a Python short int > > (platform C long). The obvious way with an explicit mutex doesn't > > have that problem. > > Xrange, of course :). I don't need to exceed the size of a short int, > so either of these should work fine. I wonder what measures the Pypy > implementers will take (if any) to make sure these things keep > working, but for now I won't worry about it. Well, for now we don't support threads. Easy! Cheers, mwh (no, really, this is for the future) -- Two things I learned for sure during a particularly intense acid trip in my own lost youth: (1) everything is a trivial special case of something else; and, (2) death is a bunch of blue spheres. -- Tim Peters, 1 May 1998 -- http://mail.python.org/mailman/listinfo/python-list