Files
openide/python/testData/resolve/OverloadsAndImplementationInClass.py
Semyon Proshev 947930f6c9 PY-22971 Fixed: Support @typing.overload in regular Python files, not only in Python stubs
Resolve:
* resolve to the first implementation in class, if there is no implementation, resolve to the first overload
* resolve to the last implementation in module, if there is no implementation, resolve to the last overload
2017-05-13 00:17:48 +03:00

22 lines
312 B
Python

from typing import overload
class A:
@overload
def foo(self, value: None) -> None:
pass
@overload
def foo(self, value: int) -> str:
pass
@overload
def foo(self, value: str) -> str:
pass
def foo(self, value):
return None
A().foo("abc")
<ref>