What's the value of "None" between 2.1.1 and 1.5.2
Christian Tanzer
tanzer at swing.co.at
Fri Nov 30 13:00:25 EST 2001
Michael Abbott <michael at rcp.co.uk> wrote:
> >> So why don't comparisons of this type generate an exception?
> >
> > Because comparisons are used in sorts, for example, and it wasn't
> > considered helpful for sorts of lists of arbitrary datatypes to raise
> > errors.
>
> Sigh. I understand.
>
> Of course, if you are sorting a list of arbitrary datatypes using random
> datatypes as the key then you're in a state of sin.
Well, I often use something like
print sorted (dictionary.items ())
at the interactive prompt and I'd sure hate it if I got an exception
instead of a nicely sorted output. In such a case, I couldn't care
less about the order between keys of different types.
--
Christian Tanzer tanzer at swing.co.at
Glasauergasse 32 Tel: +43 1 876 62 36
A-1130 Vienna, Austria Fax: +43 1 877 66 92
More information about the Python-list
mailing list