49

Is there anything in Python akin to Java's JLS or C#'s spec?

0

3 Answers 3

36

There's no specification per se. The closest thing is the Python Language Reference, which details the syntax and semantics of the language.

Sign up to request clarification or add additional context in comments.

7 Comments

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.
@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.
I think the Python Language Reference is just a reference specified for CPython?
CPython is the default/standard implementation, so it's a pretty darn good reference!
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.
|
2

You can check out the Python Reference

Comments

0

No, python is defined by its implementation.

1 Comment

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.