question about True values

Slawomir Nowaczyk slawomir.nowaczyk.847 at student.lu.se
Sat Oct 28 00:12:39 CEST 2006


On Fri, 27 Oct 2006 11:25:09 -0700
Carl Banks <pavlovevidence at gmail.com> wrote:

#> P.S. binary trees do have length: it's the number of nodes, just as
#> the number of keys is the length of a dict. I can't think of any
#> objects that use indexing but don't have a length,

Well, infinite lists (either circular or dynamically-growing) would be
one (unless you consider infinity to be a valid value of length, of
course).

Dictionaries with default value would be another (of course, Python 2.5
defaultdict *does* have length, but I would claim it is a wart).

But I agree those are pathological cases.

-- 
 Best wishes,
   Slawomir Nowaczyk
     ( Slawomir.Nowaczyk at cs.lth.se )

Programmer - A red-eyed, mumbling mammal
capable of conversing with inanimate objects.




More information about the Python-list mailing list