Message13988
Logged In: YES
user_id=80475
The problem isn't with filter() which correctly calls iter() in
both cases.
Tuple object have their own iterator which loops over
elements directly and has no intervening calls to
__getitem__().
String objects do not define a custom iterator, so iter()
wraps itself around consecutive calls to __getitem__().
The resolution is to provide string objects with their own
iterator. As a side benefit, iteration will run just a tiny bit
faster. The same applies to unicode objects.
Guido, do you care about this and want me to fix it or
would you like to close it as "won't fix".
|
|
| Date |
User |
Action |
Args |
| 2007-08-23 14:09:57 | admin | link | issue665835 messages |
| 2007-08-23 14:09:57 | admin | create | |
|