Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 1 addition & 12 deletions stdlib/@tests/stubtest_allowlists/py315.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
# TODO: Allowlist entries that should be fixed
# ============================================

_collections_abc.__all__
_frozen_importlib.BuiltinImporter.load_module
_frozen_importlib.FrozenImporter.load_module
_frozen_importlib_external.FileFinder.discover
Expand Down Expand Up @@ -143,7 +142,6 @@ codecs.strict_errors
codecs.xmlcharrefreplace_errors
collections.Counter.__ixor__
collections.Counter.__xor__
collections.abc.__all__
concurrent.interpreters._crossinterp.UNBOUND_ERROR
concurrent.interpreters._crossinterp.UNBOUND_REMOVE
concurrent.interpreters._crossinterp.UnboundItem.singleton
Expand Down Expand Up @@ -391,25 +389,16 @@ types.UnionType.__qualname__
types.__all__
typing.LiteralString
typing.NewType.__mro_entries__
typing.NoExtraItems
typing.ParamSpec.__mro_entries__
typing.ParamSpecArgs.__mro_entries__
typing.ParamSpecKwargs.__mro_entries__
typing.SupportsAbs.__type_params__
typing.SupportsRound.__type_params__
typing.TypeAliasType.__qualname__
typing.TypeForm
typing.TypeVar.__mro_entries__
typing.TypeVarTuple.__bound__
typing.TypeVarTuple.__contravariant__
typing.TypeVarTuple.__covariant__
typing.TypeVarTuple.__infer_variance__
typing.TypeVarTuple.__mro_entries__
typing.Union
typing._SpecialForm.__mro_entries__
typing.__all__
typing.disjoint_base
typing.no_type_check_decorator
typing_extensions.__all__
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typing-extensions still has no_type_check_decorator in __all__ but it no longer exists at runtime, we'll have to fix this

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

didn't this get fixed in python/typing_extensions#723

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not released yet I think

typing_extensions.Protocol
unicodedata.block
unicodedata.extended_pictographic
Expand Down
3 changes: 2 additions & 1 deletion stdlib/_collections_abc.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,9 @@ __all__ = [
"ValuesView",
"Sequence",
"MutableSequence",
"ByteString",
]
if sys.version_info < (3, 15):
__all__ += ["ByteString"]
if sys.version_info >= (3, 12):
__all__ += ["Buffer"]

Expand Down
54 changes: 46 additions & 8 deletions stdlib/typing.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ __all__ = [
"AsyncIterator",
"Awaitable",
"BinaryIO",
"ByteString",
"Callable",
"ChainMap",
"ClassVar",
Expand Down Expand Up @@ -110,14 +109,19 @@ __all__ = [
"get_type_hints",
"is_typeddict",
"no_type_check",
"no_type_check_decorator",
"overload",
"runtime_checkable",
]

if sys.version_info < (3, 15):
__all__ += ["ByteString", "no_type_check_decorator"]

if sys.version_info >= (3, 14):
__all__ += ["evaluate_forward_ref"]

if sys.version_info >= (3, 15):
__all__ += ["NoExtraItems", "TypeForm", "disjoint_base"]

if sys.version_info >= (3, 11):
__all__ += [
"LiteralString",
Expand Down Expand Up @@ -258,11 +262,31 @@ if sys.version_info >= (3, 11):
class TypeVarTuple:
@property
def __name__(self) -> str: ...
if sys.version_info >= (3, 15):
@property
def __bound__(self) -> Any | None: ... # AnnotationForm
@property
def __covariant__(self) -> bool: ...
@property
def __contravariant__(self) -> bool: ...
@property
def __infer_variance__(self) -> bool: ...
if sys.version_info >= (3, 13):
@property
def __default__(self) -> Any: ... # AnnotationForm
def has_default(self) -> bool: ...
if sys.version_info >= (3, 13):
if sys.version_info >= (3, 15):
def __new__(
cls,
name: str,
*,
bound: Any | None = None, # AnnotationForm
covariant: bool = False,
contravariant: bool = False,
default: Any = ..., # AnnotationForm
infer_variance: bool = False,
) -> Self: ...
elif sys.version_info >= (3, 13):
def __new__(cls, name: str, *, default: Any = ...) -> Self: ... # AnnotationForm
elif sys.version_info >= (3, 12):
def __new__(cls, name: str) -> Self: ...
Expand Down Expand Up @@ -397,12 +421,16 @@ _TC = TypeVar("_TC", bound=type[object])
def overload(func: _F) -> _F: ...
def no_type_check(arg: _F) -> _F: ...

if sys.version_info >= (3, 13):
@deprecated("Deprecated since Python 3.13; removed in Python 3.15.")
def no_type_check_decorator(decorator: Callable[_P, _T]) -> Callable[_P, _T]: ...
if sys.version_info < (3, 15):
if sys.version_info >= (3, 13):
@deprecated("Deprecated since Python 3.13; removed in Python 3.15.")
def no_type_check_decorator(decorator: Callable[_P, _T]) -> Callable[_P, _T]: ...

else:
def no_type_check_decorator(decorator: Callable[_P, _T]) -> Callable[_P, _T]: ...
else:
def no_type_check_decorator(decorator: Callable[_P, _T]) -> Callable[_P, _T]: ...

if sys.version_info >= (3, 15):
def disjoint_base(cls: _TC) -> _TC: ...

# This itself is only available during type checking
def type_check_only(func_or_cls: _FT) -> _FT: ...
Expand All @@ -426,6 +454,13 @@ ChainMap = _Alias()
OrderedDict = _Alias()

Annotated: _SpecialForm
if sys.version_info >= (3, 15):
@type_check_only
class _NoExtraItemsType: ...

NoExtraItems: _NoExtraItemsType

TypeForm: _SpecialForm

# Predefined type variables.
AnyStr = TypeVar("AnyStr", str, bytes) # noqa: Y001
Expand Down Expand Up @@ -1147,6 +1182,9 @@ if sys.version_info >= (3, 12):
def __parameters__(self) -> tuple[Any, ...]: ... # AnnotationForm
@property
def __name__(self) -> str: ...
if sys.version_info >= (3, 15):
@property
def __qualname__(self) -> str: ...
# It's writable on types, but not on instances of TypeAliasType.
@property
def __module__(self) -> str | None: ... # type: ignore[override]
Expand Down
4 changes: 3 additions & 1 deletion stdlib/typing_extensions.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ from typing import ( # noqa: Y022,Y037,Y038,Y039,UP035
cast as cast,
is_typeddict as is_typeddict,
no_type_check as no_type_check,
no_type_check_decorator as no_type_check_decorator,
overload as overload,
type_check_only,
)
Expand Down Expand Up @@ -210,6 +209,9 @@ _TC = _TypeVar("_TC", bound=type[object])
_T_co = _TypeVar("_T_co", covariant=True) # Any type covariant containers.
_T_contra = _TypeVar("_T_contra", contravariant=True)

if sys.version_info < (3, 15):
def no_type_check_decorator(decorator: _F) -> _F: ...

# Do not import (and re-export) Protocol or runtime_checkable from
# typing module because type checkers need to be able to distinguish
# typing.Protocol and typing_extensions.Protocol so they can properly
Expand Down
Loading