Inlay hint auto-import incorrectly assumes that members are module submembers. (original) (raw)

Summary

Playground

main.py:

from dataclasses import dataclass from module import Outer

def wrap[T](x: T) -> list[T]: return [x]

y = wrap(Outer.Inner())

module.py:

class Outer: class Inner: ...

Applying the inline on y adds the Inner to from module import Outer, but Inner is not a member of module, it's a member of Outer.

Version

No response