mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-05-06 21:43:59 +08:00
builtins: improve builtins.function (#14094)
Remove two differences from types.FunctionType that should be safe to clean up.
This commit is contained in:
+21
-1
@@ -1028,7 +1028,7 @@ class function:
|
||||
__annotations__: dict[str, AnnotationForm]
|
||||
if sys.version_info >= (3, 14):
|
||||
__annotate__: AnnotateFunc | None
|
||||
__kwdefaults__: dict[str, Any]
|
||||
__kwdefaults__: dict[str, Any] | None
|
||||
if sys.version_info >= (3, 10):
|
||||
@property
|
||||
def __builtins__(self) -> dict[str, Any]: ...
|
||||
@@ -1036,6 +1036,26 @@ class function:
|
||||
__type_params__: tuple[TypeVar | ParamSpec | TypeVarTuple, ...]
|
||||
|
||||
__module__: str
|
||||
if sys.version_info >= (3, 13):
|
||||
def __new__(
|
||||
cls,
|
||||
code: CodeType,
|
||||
globals: dict[str, Any],
|
||||
name: str | None = None,
|
||||
argdefs: tuple[object, ...] | None = None,
|
||||
closure: tuple[CellType, ...] | None = None,
|
||||
kwdefaults: dict[str, object] | None = None,
|
||||
) -> Self: ...
|
||||
else:
|
||||
def __new__(
|
||||
cls,
|
||||
code: CodeType,
|
||||
globals: dict[str, Any],
|
||||
name: str | None = None,
|
||||
argdefs: tuple[object, ...] | None = None,
|
||||
closure: tuple[CellType, ...] | None = None,
|
||||
) -> Self: ...
|
||||
|
||||
# mypy uses `builtins.function.__get__` to represent methods, properties, and getset_descriptors so we type the return as Any.
|
||||
def __get__(self, instance: object, owner: type | None = None, /) -> Any: ...
|
||||
|
||||
|
||||
Reference in New Issue
Block a user