News for hackers. Stuff that matters.
Re:The CPython Bytecode Compiler Is Dumb by yegle on Sunday February 24, 2019 @09:59PM (#19242471)
> Unless the Python language specification is specific about this case

No there's no such thing called Python language specification. Every implementation of Python is based on CPython. This also leads to the sad fact that every non-CPython implementation has to provide C API that's compatible with CPython if they want to be adopted widely.

Re:The CPython Bytecode Compiler Is Dumb by bakery2k on Sunday February 24, 2019 @10:27PM (#19242643)
> Every implementation of Python is based on CPython.

Not quite true - there are notes in the documentation that call out parts of CPython's behaviour as "implementation-specific".

These are quite rare though. I seem to recall the suggestion being made that MicroPython shouldn't call itself "an implementation of Python" simply because its internal string encoding is UTF-8.

> This also leads to the sad fact that every non-CPython implementation has to provide C API that's compatible with CPython if they want to be adopted widely.

A specification for the C API wouldn't necessarily help with this. The problem for alternative implementations is that the C API is closely tied to CPython internals - there is no reason that having a specification would change that.

Designing and specifying a more abstracted API would be useful - but I don't see it happening.

Re:The CPython Bytecode Compiler Is Dumb by kazinator on Monday February 25, 2019 @01:27AM (#19243479)
> there are notes in the documentation that call out parts of CPython's behaviour as "implementation-specific"

In a document like this, that means "doing whatever CPython does in a way that we are not bothering to commit to documentation" (and that any other implementation will have to reverse engineer and implement).

Re:The CPython Bytecode Compiler Is Dumb by gjenks on Tuesday February 26, 2019 @01:13PM (#19256819)
Closest thing to a spec is the Python Language Reference: https://docs.python.org/3/reference/ which is actually pretty good.