Skip to content

Commit 6077d19

Browse files
committed
manually CP typeshed #9130
improve ast types; revert several "redundant numeric union" changes from #7906 see python/typeshed#9130
1 parent ab0ea1e commit 6077d19

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

mypy/typeshed/stdlib/_ast.pyi

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,7 @@ class JoinedStr(expr):
329329

330330
if sys.version_info < (3, 8):
331331
class Num(expr): # Deprecated in 3.8; use Constant
332-
n: complex
332+
n: int | float | complex
333333

334334
class Str(expr): # Deprecated in 3.8; use Constant
335335
s: str
@@ -349,7 +349,7 @@ class Constant(expr):
349349
kind: str | None
350350
# Aliases for value, for backwards compatibility
351351
s: Any
352-
n: complex
352+
n: int | float | complex
353353

354354
if sys.version_info >= (3, 8):
355355
class NamedExpr(expr):

mypy/typeshed/stdlib/ast.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ if sys.version_info >= (3, 8):
1010
def __init__(cls, *args: object) -> None: ...
1111

1212
class Num(Constant, metaclass=_ABC):
13-
value: complex
13+
value: int | float | complex
1414

1515
class Str(Constant, metaclass=_ABC):
1616
value: str

0 commit comments

Comments
 (0)