mirror of
https://github.com/python/cpython.git
synced 2025-07-16 07:45:20 +00:00
create NameConstant AST class for None, True, and False literals (closes #16619)
This commit is contained in:
parent
4b237e3b11
commit
442f20996d
15 changed files with 152 additions and 72 deletions
|
@ -307,6 +307,9 @@ class Unparser:
|
|||
def _Name(self, t):
|
||||
self.write(t.id)
|
||||
|
||||
def _NameConstant(self, t):
|
||||
self.write(repr(t.value))
|
||||
|
||||
def _Num(self, t):
|
||||
# Substitute overflowing decimal literal for AST infinities.
|
||||
self.write(repr(t.n).replace("inf", INFSTR))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue