mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-22 03:41:28 +08:00
* Adapt number types in ast Since mypy 0.990 type promotions was limited. This means that complex is not longer promoted to int/float, therefore we should adapt the types to list all possible types Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: AlexWaygood <alex.waygood@gmail.com>
This commit is contained in:
@@ -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
|
||||
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user