Proposed new syntax
Ben Finney
ben+python at benfinney.id.au
Thu Aug 24 06:40:51 EDT 2017
Paul Rubin <no.email at nospam.invalid> writes:
> Ben Finney <ben+python at benfinney.id.au> writes:
> > generate_id = functools.partial(next, itertools.count())
>
> Is something wrong with:
>
> >>> g = itertools.count().next
I wasn't looking for a ‘next’ method on the iterator. Is that special to
the ‘itertools.count’ type?
If so, I was attempting to give the more general solution to “how do I
get a function that will give me the next thing from this iterator”.
--
\ “If consumers even know there's a DRM, what it is, and how it |
`\ works, we've already failed.” —Peter Lee, Disney corporation, |
_o__) 2005 |
Ben Finney
More information about the Python-list
mailing list