Changing CPython’s grammar#

Abstract#

There’s more to changing Python’s grammar than editing Grammar/python.gram. Here’s a checklist.

Note

These instructions are for Python 3.9 and beyond. Earlier versions use a different parser technology. You probably shouldn’t try to change the grammar of earlier Python versions, but if you really want to, use GitHub to track down the earlier version of this file in the devguide.

For more information on how to use the new parser, check the section on how to use CPython’s parser.

Checklist#

Note: sometimes things mysteriously don’t work. Before giving up, try make clean.