8000 builtins: remove `object.__annotations__` by JelleZijlstra · Pull Request #14000 · python/typeshed · GitHub
[go: up one dir, main page]

Skip to content

builtins: remove object.__annotations__ #14000

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
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
2 changes: 0 additions & 2 deletions stdlib/@tests/stubtest_allowlists/py314.txt
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,11 @@ builtins.BaseExceptionGroup.subgroup
builtins.ExceptionGroup.split
builtins.ExceptionGroup.subgroup
builtins.bytearray.resize
builtins.classmethod.__annotate__
builtins.classmethod.__class_getitem__
builtins.complex.from_number
builtins.float.from_number
builtins.int.__round__
builtins.memoryview.__class_getitem__
builtins.staticmethod.__annotate__
builtins.staticmethod.__class_getitem__
code.compile_command
codeop.compile_command
Expand Down
7 changes: 6 additions & 1 deletion stdlib/builtins.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,6 @@ class object:
__doc__: str | None
__dict__: dict[str, Any]
__module__: str
__annotations__: dict[str, Any]
@property
def __class__(self) -> type[Self]: ...
@__class__.setter
Expand Down Expand Up @@ -154,6 +153,9 @@ class staticmethod(Generic[_P, _R_co]):
@property
def __wrapped__(self) -> Callable[_P, _R_co]: ...
def __call__(self, *args: _P.args, **kwargs: _P.kwargs) -> _R_co: ...
__annotations__: dict[str, AnnotationForm]
if sys.version_info >= (3, 14):
__annotate__: AnnotateFunc | None

class classmethod(Generic[_T, _P, _R_co]):
@property
Expand All @@ -170,6 +172,9 @@ class classmethod(Generic[_T, _P, _R_co]):
__qualname__: str
@property
def __wrapped__(self) -> Callable[Concatenate[type[_T], _P], _R_co]: ...
__annotations__: dict[str, AnnotationForm]
if sys.version_info >= (3, 14):
__annotate__: AnnotateFunc | None

class type:
# object.__base__ is None. Otherwise, it would be a type.
Expand Down
3 changes: 2 additions & 1 deletion stdlib/functools.pyi
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import sys
import types
from _typeshed import SupportsAllComparisons, SupportsItems
from _typeshed import AnnotationForm, SupportsAllComparisons, SupportsItems
from collections.abc import Callable, Hashable, Iterable, Sized
from types import GenericAlias
from typing import Any, Generic, Literal, NamedTuple, TypedDict, TypeVar, final, overload
Expand Down Expand Up @@ -85,6 +85,7 @@ class _Wrapped(Generic[_PWrapped, _RWrapped, _PWrapper, _RWrapper]):

class _Wrapper(Generic[_PWrapped, _RWrapped]):
def __call__(self, f: Callable[_PWrapper, _RWrapper]) -> _Wrapped[_PWrapped, _RWrapped, _PWrapper, _RWrapper]: ...
__annotations__: dict[str, AnnotationForm]

if sys.version_info >= (3, 12):
def update_wrapper(
Expand Down
Loading
0