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


Groups > comp.lang.python > #34982

Re: Supporting list()

From Skip Montanaro <skip@pobox.com>
Subject Re: Supporting list()
Date 2012-12-17 15:51 +0000
References <loom.20121217T152936-30@post.gmane.org> <50CFAB13.3010707@stoneleaf.us>
Newsgroups comp.lang.python
Message-ID <mailman.963.1355759540.29569.python-list@python.org> (permalink)

Show all headers | View raw


> 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


Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

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

csiph-web