"Ben Finney" <[EMAIL PROTECTED]> wrote:
To:
Sent: Thursday, October 26, 2006 4:44 AM
Subject: Re: basic questions on cmp, < and sort
Schüle Daniel <[EMAIL PROTECTED]> writes:
8<---
> third question
>
> so
Schüle Daniel wrote:
> first question
>
> In [117]: cmp("ABC",['A','B','C'])
> Out[117]: 1
>
> against what part of the list is the string "ABC" compared?
http://docs.python.org/lib/comparisons.html
"Objects of different types, except different numeric types and
different string
Schüle Daniel schrieb:
> first question
>
> In [117]: cmp("ABC",['A','B','C'])
> Out[117]: 1
>
> against what part of the list is the string "ABC" compared?
The names of the types are compared:
py> cmp("string", "list")
1
> second question
>
> In [119]: class X(object):
>.: pass
>
Schüle Daniel <[EMAIL PROTECTED]> writes:
> Hello,
>
> first question
>
> In [117]: cmp("ABC",['A','B','C'])
> Out[117]: 1
>
> against what part of the list is the string "ABC" compared?
Why "part"? There are two objects; they are compared to each other.
How this comparison is implemented is a m
Hello,
first question
In [117]: cmp("ABC",['A','B','C'])
Out[117]: 1
against what part of the list is the string "ABC" compared?
second question
In [119]: class X(object):
.: pass
.:
In [120]: X() < X()
Out[120]: True
In [121]: X() < X()
Out[121]: False
In [122]: X() < X