Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #34982 > unrolled thread

Re: Supporting list()

Started bySkip Montanaro <skip@pobox.com>
First post2012-12-17 15:51 +0000
Last post2012-12-17 15:51 +0000
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: Supporting list() Skip Montanaro <skip@pobox.com> - 2012-12-17 15:51 +0000

#34982 — Re: Supporting list()

FromSkip Montanaro <skip@pobox.com>
Date2012-12-17 15:51 +0000
SubjectRe: Supporting list()
Message-ID<mailman.963.1355759540.29569.python-list@python.org>
> If using __getitem__ it needs to work with integers from 0 to len(f)-1,
> and raise IndexError for len(f), len(f+1), etc.

Ah, thanks.  I have a __getitem__ method, but it currently doesn't raise
IndexError.  (I'm indexing into a ring buffer, and the usage of the class
pretty much precludes indexing with an out-of-bounds index.)

S


[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web