3 ms·
> Unless the Python language specification is specific about this case No there's no such thing called Python language specification. Every implementation of P
by yegle 8y ago
> 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.
- bakery2k 8y ago> 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.
- kazinator 8y ago> 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).
- gjenks 8y agoClosest thing to a spec is the Python Language Reference: https://docs.python.org/3/reference/ https://docs.python.org/3/reference/ which is actually pretty good.