Files
Mikhail Golubevandintellij-monorepo-bot 7c166c07f7 PY-85654 Unify getName() for PyCallableTypeImpl and PyFunctionTypeImpl
by lifting the implementation to PyFunctionType, so that `getName()`
for PyFunctionType no longer returns just "function".

GitOrigin-RevId: 66b64237c6dd443c5c7792c23437b8a12b79e699
2026-01-06 13:11:18 +00:00

24 lines
788 B
Python

class MyClass(object):
def method(self):
pass
@staticmethod
def static_method():
pass
# Unbound methods are still treated as __method in Python 2
MyClass.method.__func__
MyClass.method.<warning descr="Cannot find reference '__defaults__' in '(self: MyClass) -> None'">__defaults__</warning>
# Bound method with qualifier
inst = MyClass()
inst.method.__func__
inst.method.<warning descr="Cannot find reference '__defaults__' in '() -> Any'">__defaults__</warning>
# Static method
inst.static_method.<warning descr="Cannot find reference '__func__' in '() -> Any'">__func__</warning>
inst.static_method.__defaults__
MyClass.static_method.<warning descr="Cannot find reference '__func__' in '() -> Any'">__func__</warning>
MyClass.static_method.__defaults__