mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-09 13:43:29 +07:00
Introduce PyOverloadsInspection to check that implementation exists and is located after overloads. The inspection also raise warning when overload signature is not compatible with the implementation.
37 lines
467 B
Python
37 lines
467 B
Python
from typing import overload
|
|
|
|
|
|
@overload
|
|
def foo(value: None) -> None:
|
|
pass
|
|
|
|
|
|
@overload
|
|
def foo(value: int) -> str:
|
|
pass
|
|
|
|
|
|
@overload
|
|
def foo(value: str) -> str:
|
|
pass
|
|
|
|
|
|
def foo(value):
|
|
return None
|
|
|
|
|
|
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 |