jwilk/python-syntax-errors

no-op statements syntactically valid only since Python X.Y

Python

352

121 commits

updated Jun 29, 2026

See the code

README

This is a collection of no-op statements that are syntactically valid
only since Python *X*.\ *Y*, for most *X*.\ *Y* ≥ 2.2.

For example:

.. code:: python

   0_0  # Python >= 3.6 is required

The idea is to put such a statement near the top of your file.
If a user inadvertently ran the code against an older version,
they would get a fairly helpful error message:

.. code:: console

   $ python3.5 since-3.6.py
     File "since-3.6.py", line 1
       0_0  # Python >= 3.6 is required
         ^
   SyntaxError: invalid syntax

.. vim:ft=rst ts=3 sts=3 sw=3 et

Not written in Markdown, so it's shown here as plain text — view it formatted on GitHub.

Contributors

jwilk

119 commits

andersk

2 commits

jwilk/python-syntax-errors

no-op statements syntactically valid only since Python X.Y

Python

352

121 commits

updated Jun 29, 2026

See the code

README

This is a collection of no-op statements that are syntactically valid
only since Python *X*.\ *Y*, for most *X*.\ *Y* ≥ 2.2.

For example:

.. code:: python

   0_0  # Python >= 3.6 is required

The idea is to put such a statement near the top of your file.
If a user inadvertently ran the code against an older version,
they would get a fairly helpful error message:

.. code:: console

   $ python3.5 since-3.6.py
     File "since-3.6.py", line 1
       0_0  # Python >= 3.6 is required
         ^
   SyntaxError: invalid syntax

.. vim:ft=rst ts=3 sts=3 sw=3 et

Not written in Markdown, so it's shown here as plain text — view it formatted on GitHub.

Contributors

jwilk

119 commits

andersk

2 commits

Languages

Python

81.0%

Dockerfile

19.0%