Skip to content
This repository has been archived by the owner on Dec 27, 2021. It is now read-only.

Commit

Permalink
Added precise types for ast Constants (python#4646)
Browse files Browse the repository at this point in the history
  • Loading branch information
rohitkg98 authored Nov 1, 2020
1 parent 8aa3346 commit f7a236c
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions stdlib/3/ast.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -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): ...

Expand Down

0 comments on commit f7a236c

Please sign in to comment.