On 9/30/05, Raymond Hettinger <[EMAIL PROTECTED]> wrote:
> [Guido van Rossum]
> > __len__ is for sequences and mappings specifically -- everything that
> > supports __getitem__ should have __len__ and everything that has
> > __len__ should have __getitem__.
>
> That's going a bit far. Unordered co
Guido van Rossum wrote:
> "Containerish" behavior isn't enough to warrant empty <--> false; in
> some sense every object is a container (at least every object with a
> __dict__ attribute) and you sure don't want to map __len__ to
> self.__dict__.__len__...
the ElementTree experience shows that do
[Guido van Rossum]
> __len__ is for sequences and mappings specifically -- everything that
> supports __getitem__ should have __len__ and everything that has
> __len__ should have __getitem__.
That's going a bit far. Unordered collections (like sets and bags) are
a good counter-example.
Raymon
Jim Jewett writes:
> Python doesn't worry about a precise boolean object, it
> distinguishes between something and nothing.
>
> Is there anything left?" is a pretty good analogy for iterators.
[...]
> A Queue.Queue is always true. Should I submit a bug patch
I would have phrased this very d