mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-01-23 19:41:51 +08:00
Mark fields as readonly in builtins.pyi and types.pyi (#7392)
Add FunctionType.__builtins__
This commit is contained in:
@@ -798,15 +798,21 @@ class tuple(Sequence[_T_co], Generic[_T_co]):
|
||||
@final
|
||||
class function:
|
||||
# Make sure this class definition stays roughly in line with `types.FunctionType`
|
||||
__closure__: tuple[_Cell, ...] | None
|
||||
@property
|
||||
def __closure__(self) -> tuple[_Cell, ...] | None: ...
|
||||
__code__: CodeType
|
||||
__defaults__: tuple[Any, ...] | None
|
||||
__dict__: dict[str, Any]
|
||||
__globals__: dict[str, Any]
|
||||
@property
|
||||
def __globals__(self) -> dict[str, Any]: ...
|
||||
__name__: str
|
||||
__qualname__: str
|
||||
__annotations__: dict[str, Any]
|
||||
__kwdefaults__: dict[str, Any]
|
||||
if sys.version_info >= (3, 10):
|
||||
@property
|
||||
def __builtins__(self) -> dict[str, Any]: ...
|
||||
|
||||
__module__: str
|
||||
# mypy uses `builtins.function.__get__` to represent methods, properties, and getset_descriptors so we type the return as Any.
|
||||
def __get__(self, obj: object | None, type: type | None = ...) -> Any: ...
|
||||
|
||||
Reference in New Issue
Block a user