Open
Description
Documentation
The docstring of these plugin hook methods currently say:
Lines 647 to 648 in 057508b
...
Line 664 in 057508b
I understand this to mean that the argument to fullname
will be "__main__.Base.method"
, because __main__.Base
defines method
.
However, this doesn't seem to be the case. Setting up the same example in the docstring:
mypy.ini
[mypy] plugins = plugin.py files = test.py
plugin.py
from mypy.plugin import Plugin def plugin(version): return TestPlugin class TestPlugin(Plugin): def get_method_signature_hook(self, fullname): if fullname.startswith("test."): print(f"Hook will be called with `{fullname}`")
test.py
from typing import Any class Base: def method(self, arg: Any) -> Any: ... class Derived(Base): ... var: Derived var.method(42)
$ mypy
Hook will be called with `test.Derived.method`
I installed as far back as mypy 0.9x and it was the same behaviour as described above, displaying test.Derived.method
(not test.Base.method
).
Is there something wrong with the docstring (perhaps from outdated behaviour that no longer applies), or have I misunderstood something?