Is there anything in Python akin to Java's JLS or C#'s spec?
3 Answers
There's no specification per se. The closest thing is the Python Language Reference, which details the syntax and semantics of the language.
7 Comments
Yttrill
How is the PLR not a specification? It is not a mathematically formal specification, but then neither is the ISO C or ISO C++ Standard.
Izkata
@Yttrill Maybe it was different when this answer was posted? Right now, it does look like a formal specification, in section 5 (Expressions) and onward. Sections 1-4 just look like detailed descriptions, rather than a spec.
yegle
I think the Python Language Reference is just a reference specified for CPython?
Noldorin
CPython is the default/standard implementation, so it's a pretty darn good reference!
ncoghlan
CPython specific implementation details are generally appropriately qualified in the language reference and the standard library reference. As other compliant implementations like PyPy, IronPython and Jython find areas they have a problem with, they seek clarification from python-dev as necessary (the C API, reference counting and the GIL are all CPython implementation details, for example). We sometimes even find obscure CPython bugs this way. Tests covering such areas are flagged as "cpython_only" in the regression test suite, which is also shared across the major implementations.
|
No, python is defined by its implementation.
1 Comment
Alex Martelli
Not true -- what's generally considered the de facto reference implementation (CPython) has some aspects that are NOT part of the Python Language (as defined in the Reference), such as reference counting, the GIL, &c, and other perfectly correct implementations of Python (such as Jython and IronPython) do NOT mimic these parts of CPython. So the PLR is closer to a specification, than any single implementation out of the several ones available can be.