PyDocs

Nav

Python Language Services

Constant

ast

class
  • Constant(value, kind)
Constant(constant value, string? kind)
1 Example
>>> print(ast.dump(ast.parse('123', mode='eval'), indent=4))
Expression(
    body=Constant(value=123))
>>> print(ast.dump(ast.parse("u'hello'", mode='eval'), indent=4))
Expression(
    body=Constant(value='hello', kind='u'))
from the Python docs
See Also
No see-alsos for ast/Constant
0 Notes
No notes for Constant