Division considered un-Pythonic (Re: Case-sensitivity: why -- or why not? (was Re: Damnation!))

Moshe Zadka moshez at math.huji.ac.il
Sat Jun 3 01:56:23 EDT 2000


On 2 Jun 2000 piet at cs.uu.nl wrote:

> I want to add another reason for a/b to mean floating division:
> 
> As it is now in Python, you can have a==b and c==d both being true, but
> a/c==b/d being false. Which would be a bad surprise for most people.

This is hardly a reason for floating point division. If at all, it should
be a reason for rational division, but note that the real solution is to
simply raise an exception when a float is compared with something

>>> 1.0 == 1
TypeError: illegal types for builtin operation

keeping-python's-error-messages-cryptic-ly y'rs, Z.

--
Moshe Zadka <moshez at math.huji.ac.il>
http://www.oreilly.com/news/prescod_0300.html
http://www.linux.org.il -- we put the penguin in .com





More information about the Python-list mailing list