Paul Rubin wrote: > Ben Finney <ben+pyt...@benfinney.id.au> writes: >> generate_id = functools.partial(next, itertools.count()) > > Is something wrong with: > > >>> g = itertools.count().next
That question seems to be the topic of this subthread. Other than the principle "never call a dunder method" (that I do not follow strictly) you accidentally bring up another argument: compatibility between Python 2 and Python 3 where the next() method has been renamed to __next__(). -- https://mail.python.org/mailman/listinfo/python-list