[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

About the implementation of del in Python 3

Steve D'Aprano <steve+python at pearwood.info>:

> On Fri, 7 Jul 2017 07:10 am, Marko Rauhamaa wrote:
>> I believe identity can be defined much better, in numerous isomorphic
>> ways in fact.
>> For example, we could equate each object with a sequence number
>> (unrelated with its id()). You can define that the "None" object is
>> in fact the natural number 0. The "False" object is in fact the
>> natural number 1 etc for all the primordial objects. During the
>> execution of the program, new objects are created, which simply
>> associates characteristics to ever higher natural numbers.
> Hmmm... interesting. You might just be on the right track here. That
> might even work for "identity" as required by Python.
> Of course you can't say "equate each object with its sequence number"
> since that implies that:
> assert None == 0

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.

> Are you satisfied now? Can we please put this debate to bed?

Feel free to stop replying.

These kinds of debate keep on going forever because you still don't
understand what I'm getting at (and probably vice versa).