Add __name__ field to MethodType (#1442)

See https://github.com/python/cpython/blob/08c16016e2a2d1368d001ddebfe9ca92465773c4/Lib/types.py#L32-L34

```python
>>> class _C:
...     def _m(self): pass
...
>>> _C()._m.__name__
'_m'
```
This commit is contained in:
Roy Williams
2017-06-29 10:05:25 -07:00
committed by Jelle Zijlstra
parent 9b612c9218
commit ac87de50dd
2 changed files with 2 additions and 0 deletions
+1
View File
@@ -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]