[Python-ideas] f-string "debug" conversion

Chris Angelico rosuav at gmail.com
Wed Oct 3 04:55:27 EDT 2018


On Wed, Oct 3, 2018 at 6:49 PM Anders Hovmöller <boxed at killingar.net> wrote:
>
> I don't really think accidents of implementation are different from hard requirements in Python, as it applies to alternative implementations. In practice if it deviates from CPython then it's broken. There is no language spec, there is only CPython. This has been the experience and approach of PyPy as far as I've understood it after having followed their blog over the years.
>

Definitely not true. There have been times when other implementors
have come to python-dev and said, hey, is this part of the spec or is
it an implementation detail? And the answer determines whether they
care about that or not. For just a few examples:

1) Reference counting vs nondeterministic garbage collection
2) O(1) indexing/slicing of Unicode strings
3) "\N{...}" string escapes (okay, that's standardized, but optional)
4) Reuse of id() values
5) The "slots" mechanism for dunder method lookup

The language spec determines, in some cases, that a CPython
implementation detail has been promoted to standard. More often, it
determines that other Pythons are permitted to behave differently.

ChrisA


More information about the Python-ideas mailing list