I have python code that uses __getattr__ to relay non existing member accesses to another object.
I have written a Mypy plugin which makes the type hints work.
class StrProxy(Proxy[str])
s: str
def __init__(self, s: str):
self.s = s
def get(self) -> str:
return self.s
def __deref__(self) -> str:
return s
sp = StrProxy("test")
sp.get # exists according to mypy & pylance
sp.encode # exists according to mypy only (because of my plugin)
The problem: Pylance uses its own type checker (Pyright) for autocomplete.
Is there any way I can tell Pylance to use Mypy? Or switch pylance for an LSP that respects Mypy?
mypytypechecking instead ofpyrightwarnings or to make some attributes shown in the autocomplete prompt? There should be such plugin for all major IDEs for the former, and the latter is impossible (mypydoes simply not offer such functionality, neither pyright does).