Slices time complexity

Marko Rauhamaa marko at pacujo.net
Tue May 19 14:19:26 EDT 2015


Steven D'Aprano <steve+comp.lang.python at pearwood.info>:

> On Wed, 20 May 2015 01:59 am, Marko Rauhamaa wrote:
>> You're slaying straw men.
>
> "I was wrong, but I don't want to admit it" is not spelled "straw man".
>
> You made a claim that was not defensible, and I tore that claim to shreds.
> Have the good grace to admit that your earlier position:
>
>     "it doesn't matter what semantic description you give Python 
>     constructs as long as the observed behavior is correct"

I stand by that position and haven't changed it.

> doesn't stand up to scrutiny.

But it does.

>> Jython, CPython and IronPython are supposed to be semantically
>> equivalent. So any valid CPython model is also a valid model for
>> Jython and IronPython.
>
> They are only supposed to equivalent in regards to behaviour specified by
> the language specifications,

Naturally.

> One such implementation-dependent behaviour is whether Python objects
> have a fixed location or not.

Whatever that means.

> CPython objects currently do.

As far as the process's virtual memory goes...

> Jython and IronPython objects do not, they can move in memory, so
> references in those two implementations cannot be implemented as
> pointers or memory addresses.

Semantics can be given in terms of memory addresses even if the
implementation does not have memory addresses (in the sense you're
describing).

>>> Mixing descriptions of a specific implementation with descriptions
>>> of the high level semantics is sometimes useful but often
>>> misleading, and one needs to be careful how and when one does it.
>> 
>> Nobody has proposed doing that.
>
> You did. Pointers are the CPython implementation, they are not the
> high level semantics.

The semantics can be expressed in any manner whatsoever regardless of
how Python has been "really" implemented. Formally, informally. In
English. In Russian. Using Turing machines, using x86 machine language,
using Forth. There's an infinitum of isomorphic descriptions, some
instructive, some confusing.

The touchstone is the observed behavior.


Marko



More information about the Python-list mailing list