Message13995
Logged In: YES
user_id=80475
One other thought: A major reason for implementing
__iter__ in the first place is that objects were overriding
__getitem__ and disregarding the index -- the __getitem__
interface just didn't make sense for iteration in some
situations. __iter__ was supposed to provide enormous
flexibility in various ways to loop over a collection (inorder,
preorder, postorder, priorityorder, sortedorder, hashorder,
randomorder, etc). Making iter() default to using
__getitem__ was only supposed to be an expedient for
backwards compatability. Always using __getitem__
diminishes the flexibility and speed advantages.
Maybe the discussion belongs on python-dev. I'm sure a
number of people feel strongly one way or the other. The
question might as well be addressed head-on before 2.3
goes out the door. |
|
| Date |
User |
Action |
Args |
| 2007-08-23 14:09:57 | admin | link | issue665835 messages |
| 2007-08-23 14:09:57 | admin | create | |
|