Testing validity of for...in...

Andrew Dalke adalke at mindspring.com
Tue Nov 4 10:14:57 CET 2003


Peter Otten:
> Your implementation makes two implicit tests:
>
> 1. Is mylist iterable
> 2. Do the items in mylist have a length

It also fails if len(item) returns a different values when
called multiple times for a given item.

                    Andrew
                    dalke at dalkescientific.com






More information about the Python-list mailing list