From characters to program structure
Lexical rules organize source characters into tokens such as names, literals and operators. Syntax determines how these form expressions, statements and other structures. A symbol inside a comment or string need not have its operator meaning.
Python’s reference uses formal grammar for lexical and syntactic rules and prose for much else. A keyword list alone therefore does not define a language: structure, naming and the meaning of operations also matter.
References: [1]
Syntactic validity does not guarantee successful execution
Valid syntax establishes an allowed structure rather than a successful result. In Python, adding the string '2' to the integer 2 parses but raises TypeError when executed; a missing required colon instead causes a syntax error.
Execution can also encounter unbound names, division by zero or unavailable resources, under the language and relevant interface rules. Diagnosing such a failure does not automatically supply a correct application-level response.
References: [2]
One language can have multiple implementations
Compilers and interpreters implement language behavior using particular representations, runtimes and optimizations. CPython and PyPy are Python implementations with different internals; bytecode or JIT choices are not universal requirements of the language.
Implementations can expose extensions and limitations, and versions can change supported rules. Portability requires checking the language version, implementation, libraries and environment, not assuming identical capabilities or performance from similar-looking source alone.
References: [1]