[issue6324] "in" expression falls back to __iter__ before __getitem__

2009-10-21 Thread Raymond Hettinger
Changes by Raymond Hettinger : -- assignee: rhettinger -> georg.brandl ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubsc

[issue6324] "in" expression falls back to __iter__ before __getitem__

2009-10-21 Thread Anthony Foglia
Anthony Foglia added the comment: I've added Python 2.7 to the list of versions. The development docs have the same issue. Let me try another stab at what the docs should say. Following the suggestion to add it to 3.3.5, perhaps it should be: " object.__contains__(self, item) Called to i

[issue6324] "in" expression falls back to __iter__ before __getitem__

2009-10-22 Thread Georg Brandl
Georg Brandl added the comment: Thanks, fixed in r75606. -- resolution: -> fixed status: open -> closed ___ Python tracker ___ ___ Py

[issue6324] "in" expression falls back to __iter__ before __getitem__

2009-06-22 Thread Anthony Foglia
New submission from Anthony Foglia : I was debugging a class where I defined __getitem__ and __iter__, but not __contains__. The documentation describing this case (at the end of section 5.9) is old and hasn't been updated for the iterator protocol. It should read something like: "For user-d

[issue6324] "in" expression falls back to __iter__ before __getitem__

2009-06-22 Thread Raymond Hettinger
Changes by Raymond Hettinger : -- assignee: georg.brandl -> rhettinger nosy: +rhettinger ___ Python tracker ___ ___ Python-bugs-list ma

[issue6324] "in" expression falls back to __iter__ before __getitem__

2009-06-26 Thread Terry J. Reedy
Terry J. Reedy added the comment: In 3.1, Section 5.9 has " For user-defined classes which define the __contains__() method, x in y is true if and only if y.__contains__(x) is true. For user-defined classes which do not define __contains__() and do define __getitem__(), x in y is true if and on

[issue6324] "in" expression falls back to __iter__ before __getitem__

2009-06-26 Thread Terry J. Reedy
Terry J. Reedy added the comment: Side note: 2.5, including, I believe, the docs, is frozen except for security fixes. If you find 2.5 doc issues, please check the current 2.x development version, currently http://docs.python.org/dev/ to see if they have been fixed or not. -- versions:

[issue6324] "in" expression falls back to __iter__ before __getitem__

2009-06-26 Thread Raymond Hettinger
Raymond Hettinger added the comment: 3.0 is no longer supported either -- versions: -Python 3.0 ___ Python tracker ___ ___ Python-bug