Any list larger than any number by way of dimensions?
Reinhold Birkenfeld
reinhold-birkenfeld-nospam at wolke7.net
Wed Jun 30 06:48:50 EDT 2004
David Fraser wrote:
> Dan Bishop wrote:
>> Harald Massa <cpl.19.ghum at spamgourmet.com> wrote in message news:<Xns9516E5F85104Ecpl19ghumspamgourmet at 195.20.224.116>...
>>
>>>Peter,
>>>
>>>
>>>>data = [ ... some list ]
>>>>buffersize = min(data,10)
>>>>
>>>>Of course what I really wanted was
>>>>
>>>>buffersize = min(len(data),10)
>>>
>>>if my memory suits me right, when everything else fails, Python is just
>>>comparing the IDs of the objects. IDs are connected to the memory
>>>addresses.
>>
>>
>> That's true for user-defined objects, but for built-in types the rule is
>>
>> None < number < list < string < tuple
>>
>> Which is consistent but wrong.
>
> It's consistent but arbitrary. How can you say its wrong? It does what
> its defined to do.
You cannot say it is "wrong" in the usual sense that a string would have
to be greater than a tuple, but in my eyes it is "wrong" that the types
even give a result when compared, as opposed to raising a TypeError or
something like this.
IMHO, this behavior is only useful for implementing ugly tricks that
should be avoided anyway, so I vote for removing this comparability.
Reinhold
--
Wenn eine Linuxdistribution so wenig brauchbare Software wie Windows
mitbrächte, wäre das bedauerlich. Was bei Windows der Umfang eines
"kompletten Betriebssystems" ist, nennt man bei Linux eine Rescuedisk.
-- David Kastrup in de.comp.os.unix.linux.misc
More information about the Python-list
mailing list