Add missing metaclasses in ast and contextlib (#8497)

This commit is contained in:
Nikita Sobolev
2022-08-08 18:08:07 +03:00
committed by GitHub
parent 28fde2ee27
commit 4e5d9d1cca
2 changed files with 16 additions and 7 deletions

View File

@@ -5,21 +5,25 @@ from typing import Any, TypeVar, overload
from typing_extensions import Literal
if sys.version_info >= (3, 8):
class Num(Constant):
class _ABC(type):
if sys.version_info >= (3, 9):
def __init__(cls, *args: object) -> None: ...
class Num(Constant, metaclass=_ABC):
value: complex
class Str(Constant):
class Str(Constant, metaclass=_ABC):
value: str
# Aliases for value, for backwards compatibility
s: str
class Bytes(Constant):
class Bytes(Constant, metaclass=_ABC):
value: bytes
# Aliases for value, for backwards compatibility
s: bytes
class NameConstant(Constant): ...
class Ellipsis(Constant): ...
class NameConstant(Constant, metaclass=_ABC): ...
class Ellipsis(Constant, metaclass=_ABC): ...
if sys.version_info >= (3, 9):
class slice(AST): ...