Add __code__ to types.MethodType (#12749)

This commit is contained in:
Avasam
2024-10-08 04:30:49 -04:00
committed by GitHub
parent 8bc20e7415
commit 1f4031cc96
2 changed files with 3 additions and 0 deletions

View File

@@ -494,6 +494,7 @@ typing(_extensions)?\.TextIO\.newlines
typing(_extensions)?\.(Async)?ContextManager
types.MethodType.__closure__ # read-only but not actually a property; stubtest thinks it doesn't exist.
types.MethodType.__code__ # read-only but not actually a property; stubtest thinks it doesn't exist.
types.MethodType.__defaults__ # read-only but not actually a property; stubtest thinks it doesn't exist.
types.ModuleType.__dict__ # read-only but not actually a property; stubtest thinks it's a mutable attribute.
types.ModuleType.__getattr__ # this doesn't exist at runtime

View File

@@ -424,6 +424,8 @@ class MethodType:
@property
def __closure__(self) -> tuple[CellType, ...] | None: ... # inherited from the added function
@property
def __code__(self) -> CodeType: ... # inherited from the added function
@property
def __defaults__(self) -> tuple[Any, ...] | None: ... # inherited from the added function
@property
def __func__(self) -> Callable[..., Any]: ...