This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author doerwalter
Recipients
Date 2007-07-08.09:33:32
SpamBayes Score
Marked as misclassified
Message-id
In-reply-to
Content
This patch adds itertools.getitem() which is basically equivalent to the following python code:

_default = object()

def getitem(iterable, index, default=_default):
   try:
      return list(iterable)[index]
   except IndexError:
      if default is _default:
         raise
      return default

but without materializing the complete list. Negative indexes are supported too.
History
Date User Action Args
2007-08-23 15:58:56adminlinkissue1749857 messages
2007-08-23 15:58:56admincreate