create NameConstant AST class for None, True, and False literals (closes #16619)

This commit is contained in:
Benjamin Peterson 2012-12-06 17:41:04 -05:00
parent 4b237e3b11
commit 442f20996d
15 changed files with 152 additions and 72 deletions

View file

@ -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))