f---ing typechecking

Steven D'Aprano steve at REMOVEME.cybersource.com.au
Wed Feb 14 20:51:30 EST 2007


On Wed, 14 Feb 2007 13:25:21 -0800, James Stroud wrote:

> But then again, the unimaginative defense would be that it wouldn't be 
> python if you could catentate a list and a tuple.

Since lists and tuples are completely different objects with completely
different usages, what should concatenating a list and a tuple give?
Should it depend on the order you pass them?

1.0 + 1 == 1 + 1.0 for very good reasons: we consider (for pragmatic
reasons to do with loss of significant digits) that floats coerce ints
into floats rather than the other way around. But what should lists and
tuples do?

>From the Zen of Python:
"In the face of ambiguity, refuse the temptation to guess."



-- 
Steven D'Aprano 




More information about the Python-list mailing list