About the implementation of del in Python 3

Marko Rauhamaa marko at pacujo.net
Fri Jul 7 05:15:43 EDT 2017


Chris Angelico <rosuav at gmail.com>:

> On Fri, Jul 7, 2017 at 6:43 PM, Marko Rauhamaa <marko at pacujo.net> wrote:
>> Python's integer object 0 might be equated with the (mathematical)
>> natural number 18974387634. Python code would have no way of
>> introspecting that natural number.
>>
>> The execution model would determine what properties object 18974387634
>> would have.
>
> Then what's the point of that number? If you can't see it from Python
> code, it's not part of the language semantics.

Excellent question!!!

In fact, it is a very frustrating question. You can only define the
semantics of Python (in this case) by providing an *arbitrary* mapping
to an imaginary abstract machine. There's no way to define the objective
abstraction.

Metamathematicians grappled with the same problem a century ago when
they tried to define natural numbers. Their promising start collapsed
because of the Russel paradox. To their great disappointment, they had
to choose an arbitrary set-theoretical model to be the standard:

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

In fact, today's mathematicians couldn't care less what natural numbers
are. They have captured all relevant characteristics in a number axioms,
and those suffice to generate all interesting mathematics.


Marko



More information about the Python-list mailing list