Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > Re: Supporting list()

Reply
Thread Tools

Re: Supporting list()

 
 
Skip Montanaro
Guest
Posts: n/a
 
      12-17-2012
> 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



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Wireless Bridge Supporting PEAP-MSCHAPv2 Ernie Wireless Networking 0 09-29-2005 05:42 PM
Sample for supporting file attachements Ryan ASP .Net 4 12-21-2004 06:37 PM
Any Active-X object supporting Drag and drop upload? Eilsa ASP .Net 0 11-23-2004 02:32 AM
Firewall supporting MIDCOM or any API for management Josip Gracin Cisco 0 10-06-2004 08:12 AM
Re: How to debug supporting classes in ASP.Net project Davide Vernole [MVP] ASP .Net 0 09-03-2004 04:39 PM



Advertisments