Counterintuitive Python behavior
Greg Ewing
greg at cosc.canterbury.ac.nz
Mon Apr 22 22:30:27 EDT 2002
Steve Holden wrote:
>
> I don't feel you have yet even adequately *defined* "conceptual sameness",
> so it's surely premature to assert that it's missing from the language.
The definition he seems to have in mind is something like
def eq(a, b):
if is_immutable(a) and is_immutable(b):
return a == b
else:
return a is b
for some suitable definition of is_immutable.
--
Greg Ewing, Computer Science Dept, University of Canterbury,
Christchurch, New Zealand
To get my email address, please visit my web page:
http://www.cosc.canterbury.ac.nz/~greg
More information about the Python-list
mailing list