mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-06 12:14:27 +08:00
Added precise types for ast Constants (#4646)
This commit is contained in:
@@ -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): ...
|
||||
|
||||
|
||||
Reference in New Issue
Block a user