Skip to content

Commit c93d1c8

Browse files
committed
Thanks Alex
1 parent 5be0cbe commit c93d1c8

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

typeshed_client/parser.py

+2-5
Original file line numberDiff line numberDiff line change
@@ -353,11 +353,8 @@ class _LiteralEvalVisitor(ast.NodeVisitor):
353353
def __init__(self, ctx: SearchContext) -> None:
354354
self.ctx = ctx
355355

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
356+
def visit_Constant(self, node: ast.Constant) -> object:
357+
return node.value
361358

362359
# from version 3.9 on an index is represented as the value directly
363360
if sys.version_info < (3, 9):

0 commit comments

Comments
 (0)