Skip to content

Commit

Permalink
manually CP typeshed #9130
Browse files Browse the repository at this point in the history
improve ast types; revert several "redundant numeric union" changes from #7906
see python/typeshed#9130
  • Loading branch information
svalentin committed Nov 14, 2022
1 parent ab0ea1e commit 6077d19
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions mypy/typeshed/stdlib/_ast.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,7 @@ class JoinedStr(expr):

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

class Str(expr): # Deprecated in 3.8; use Constant
s: str
Expand All @@ -349,7 +349,7 @@ class Constant(expr):
kind: str | None
# Aliases for value, for backwards compatibility
s: Any
n: complex
n: int | float | complex

if sys.version_info >= (3, 8):
class NamedExpr(expr):
Expand Down
2 changes: 1 addition & 1 deletion mypy/typeshed/stdlib/ast.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ if sys.version_info >= (3, 8):
def __init__(cls, *args: object) -> None: ...

class Num(Constant, metaclass=_ABC):
value: complex
value: int | float | complex

class Str(Constant, metaclass=_ABC):
value: str
Expand Down

0 comments on commit 6077d19

Please sign in to comment.