mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-07 12:44:28 +08:00
Add __name__ field to MethodType (#1442)
See 08c16016e2/Lib/types.py (L32-L34)
```python
>>> class _C:
... def _m(self): pass
...
>>> _C()._m.__name__
'_m'
```
This commit is contained in:
committed by
Jelle Zijlstra
parent
9b612c9218
commit
ac87de50dd
@@ -82,6 +82,7 @@ class UnboundMethodType:
|
||||
im_class = ... # type: type
|
||||
im_func = ... # type: FunctionType
|
||||
im_self = ... # type: Optional[object]
|
||||
__name__ = ... # type: str
|
||||
__func__ = im_func
|
||||
__self__ = im_self
|
||||
def __call__(self, *args: Any, **kwargs: Any) -> Any: ...
|
||||
|
||||
@@ -139,6 +139,7 @@ class _StaticFunctionType:
|
||||
class MethodType:
|
||||
__func__ = ... # type: _StaticFunctionType
|
||||
__self__ = ... # type: object
|
||||
__name__ = ... # type: str
|
||||
def __call__(self, *args: Any, **kwargs: Any) -> Any: ...
|
||||
class BuiltinFunctionType:
|
||||
__self__ = ... # type: Union[object, ModuleType]
|
||||
|
||||
Reference in New Issue
Block a user