From f7a236cfc055af6887d0e370f65a06aefe7e6840 Mon Sep 17 00:00:00 2001 From: Kaushal Rohit Date: Mon, 2 Nov 2020 02:46:04 +0530 Subject: [PATCH] Added precise types for ast Constants (#4646) --- stdlib/3/ast.pyi | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/stdlib/3/ast.pyi b/stdlib/3/ast.pyi index 8011424cf..e01d3d0df 100644 --- a/stdlib/3/ast.pyi +++ b/stdlib/3/ast.pyi @@ -14,9 +14,16 @@ from typing_extensions import Literal from _ast import * # type: ignore if sys.version_info >= (3, 8): - class Num(Constant): ... - class Str(Constant): ... - class Bytes(Constant): ... + class Num(Constant): + value: complex + class Str(Constant): + value: str + # Aliases for value, for backwards compatibility + s: str + class Bytes(Constant): + value: bytes + # Aliases for value, for backwards compatibility + s: bytes class NameConstant(Constant): ... class Ellipsis(Constant): ...