Hierarchy of types ?

Eugene Druker eugene_druker at yahoo.com
Fri Apr 25 22:16:33 CEST 2003


Hi All,

I'd like to understand how to use types properly.
I want to find extremums of non-sequences. 

>>> min(0,[1,2,3],4)
0
>>> max(0,[1,2,3],4)
[1, 2, 3]

It does not look very naturally...
So, may be first compared are types:

>>> type(0) < type([1,2,3])
1

It's better - I can find extremums type-by-type. However:

>>> type(int) < type(list)
0

Any explanations ?
(Python 2.2.1 (#34, Apr  9 2002, 19:34:33) [MSC 32 bit (Intel)] on win32)
Thanks,
Eugene




More information about the Python-list mailing list