Any list larger than any number by way of dimensions?

Peter Knoerrich flamewise at yahoo.com
Mon Jun 28 18:06:29 CEST 2004


Khrm,

just today I ran over some bit of (my!) code that inadvertently had omitted
a len() function call:

data = [ ... some list ]
buffersize = min(data,10)

Of course what I really wanted was

buffersize = min(len(data),10)

It happens so that I'd have expected python to bark at me for that like
I deserve, except it didn't. In fact my freshest python 2.3.4 - just
downloaded and compiled - seems to think that any list is larger than any
single number:

$ ./python
Python 2.3.4 (#1, Jun 28 2004, 17:36:42)
[GCC 3.3.2 20031218 (Gentoo Linux 3.3.2-r5, propolice-3.3-7)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> [] > 1e99999
True
>>>

Now in a way that makes a lot of sense, since one could fold up any
one-dimensional space just tightly enough for it to fit into any
two-dimensional space (even very small ones).

Still, to use a british expression, where's the beef? Is there some
subtle philosophical point to this like the distinction between split and
join? I hesitate to report this as a bug, even though it could have made
my day pretty miserable if that buffersize above had been short.

Have a good day in any dimension you happen to inhabit and don't worry:
If anyone's going to fold you up and put you into a tiny cubicle in
a higher dimenstion you'll just never know.

Peter-With-The-Snakes Knörrich
Dr. Hagen & Partner GmbH
knoerrich at hagen-partner.de



More information about the Python-list mailing list