Skip to content
Advertisement

What is NAME in the Python3 grammar specification

I wish to contribute to an open-source Python lexer. I’m looking at the official Python3 grammar specification: https://docs.python.org/3/reference/grammar.html

However, there are a lot of references to ‘NAME’. For example:

dotted_name:
    | dotted_name '.' NAME 
    | NAME

I know it’s something similar to an identifier but where can I find out more detail?

What is NAME?

Advertisement

Answer

These are constants which represent the numeric values of leaf nodes of the parse tree (terminal tokens). See more information at token — Constants used with Python parse trees and Your Guide to the CPython Source Code

Advertisement