True/False story... (PEP 285)

Ken Seehof kseehof at neuralintegrator.com
Tue Apr 9 19:19:16 EDT 2002


> Alex Martelli wrote:
> 
> > there IS a natural mapping of booleans onto a subset
> > of integers, just as there is a natural mapping of
> > integers onto a subset of reals (or rationals, etc).
> 
> Could be argued that there is no single natural mapping, for an 
> alternate to the current one we could have
> 
> True     == 1
> False    == -1
> not x    == -x
> x and y  == min(x,y)
> x or y   == max(x,y)
> x xor y  == -x*y
> 
> A nice feature of that one (to my aesthetics), is that
> 
> 1j == sqrt(False)
> 
> It also meshes well with the cyclotomic fields.
> 
> Boris
> --
> "Hope achieves the square root of the impossible"
 
Cool.  And it maps to our linguistic understanding of positive
and negative.  Hey, let's write a PEP :-)

(I hope Guido doesn't ruin it for us by pointing out that there
is only one mapping of bool to a subset of int that is backward
compatible.)

Also, I think we should change the mapping of integers to floats.
Using an logarithmic scale would have many advantages.  Now some
of the integers would no longer be permitted (i<1).  This is
consistent with the observation that 0 is a kind of None, and
therefore shouldn't exist.  People focus way too much on the
negative.  This PEP will help people be more positive.

Combined with your PEP, this leaves us with only Truth!

- Ken
"Most of the complexity of computer science would be removed by
the abolition of zero."






More information about the Python-list mailing list