3 ms·
Python's semantics do not have a standards document or specification. It's based on its reference implementation (CPython) and different variations of Python ev
by Kranar 3y ago
Python's semantics do not have a standards document or specification. It's based on its reference implementation (CPython) and different variations of Python even have different semantics (Jython, IronPython, PyPy).
The library is documented, and the syntax is also documented, but the semantics themselves are not.
- eesmith 3y agoIt isn't as dire as you suggest. The language reference at https://docs.python.org/3/reference/index.html https://docs.python.org/3/reference/index.html "describes the syntax and “core semantics” of the language.". There has been a distinction between Python-the-language and CPython-the-implementation ever since JPython back in the 1990s. For example, reference counting is a CPython implementation details. The reference manual says only: > Objects are never explicitly destroyed; however, when they become unreachable they may be garbage-collected. An implementation is allowed to postpone garbage collection or omit it altogether — it is a matter of implementation quality how garbage collection is implemented, as long as no objects are collected that are still reachable. (Quoting https://docs.python.org/3/reference/datamodel.html https://docs.python.org/3/reference/datamodel.html )
- Kranar 3y agoAbsolutely, but note what your very quote says "describes ... the language" rather than "prescribes ... the language". A standards document or specification's purpose is to "prescribe" how a system shall work in order to be compliant as opposed to a reference which documents how systems currently happen to work.