I am never going to complain about Python again

Joshua Landau joshua at landau.ws
Fri Oct 11 04:17:37 EDT 2013


On 11 October 2013 03:08, Steven D'Aprano
<steve+comp.lang.python at pearwood.info> wrote:
> Your mistake here seems to be that you're assuming that if two numbers
> are equal, they must be in the same domain, but that's not the case.
> (Perhaps you think that 0.0 == 0+0j should return False?) It's certainly
> not the case when it comes to types in Python, and it's not even the case
> in mathematics. Given:
>
> x ∈ ℝ, x = 2  (reals)
> y ∈ ℕ, y = 2  (natural numbers)
>
> we have x = y, but since 1/y is undefined (there is no Natural number
> 1/2), 1/x != 1/y.

Surely 1/y is perfectly well defined, as only y, not 1/y, is
constrained to the natural numbers.



More information about the Python-list mailing list