Devanagari int literals [was Re: Should non-security 2.7 bugs be fixed?]

Marko Rauhamaa marko at
Tue Jul 21 12:13:38 CEST 2015

Chris Angelico <rosuav at>:

> On Tue, Jul 21, 2015 at 7:10 PM, Marko Rauhamaa <marko at> wrote:
>> This is getting deep. It is an embarrassing metamathematical fact
>> that numbers cannot be defined. At least, mathematicians gave up
>> trying a century ago.
>>    In mathematics, the essence of counting a set and finding a result
>>    n, is that it establishes a one to one correspondence (or
>>    bijection) of the set with the set of numbers {1, 2, ..., n}.
>>    <URL:>
> AIUI, zero is defined as the cardinality of the empty set, one is
> defined as the cardinality of the set containing the empty set, two is
> defined as the cardinality of the set containing the empty set and the
> set containing the set containing the empty set... which makes
> mathematics the only language *more verbose* than the Shakespeare
> Programming Language in its definition of fundamental constants.

   There are two approaches to cardinality – one which compares sets
   directly using bijections and injections, and another which uses
   cardinal numbers.

The first approach is comparative, the second approach is quantitative.
You must be referring to the latter meaning (cardinality ~ cardinal
number). However:

   In mathematics, cardinal numbers, or cardinals for short, are a
   generalization of the natural numbers [...]

IOW, cardinal numbers assume natural numbers as a given. Thus, your
definition of natural numbers leads to a circular definition.

Frege et al tried to do the natural thing and defined natural numbers as
equivalence classes:

   0 = the set of sets with no elements
   1 = the set of sets with a single element
   2 = the set of sets with precisely two elements

Unfortunately, the natural thing leads to a contradiction and must be

Nowadays, mathematicians are content with working with one prototypical
chain of beads:

   0 = ∅
   1 = { 0 }
   2 = { 0, 1 }
   3 = { 0, 1, 2 }


   0 = ∅
   σ(n) = n ∪ { n }

and forget about the true essence of numbers.


More information about the Python-list mailing list