We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 5be0cbe commit c93d1c8Copy full SHA for c93d1c8
typeshed_client/parser.py
@@ -353,11 +353,8 @@ class _LiteralEvalVisitor(ast.NodeVisitor):
353
def __init__(self, ctx: SearchContext) -> None:
354
self.ctx = ctx
355
356
- def visit_Num(self, node: ast.Num) -> Union[int, float, complex]:
357
- return node.n
358
-
359
- def visit_Str(self, node: ast.Str) -> str:
360
- return node.s
+ def visit_Constant(self, node: ast.Constant) -> object:
+ return node.value
361
362
# from version 3.9 on an index is represented as the value directly
363
if sys.version_info < (3, 9):
0 commit comments