Support `TypedDict` keys showing their docs on hover
Description
from typing import TypedDict, Unpack
class Person(TypedDict):
name: str
"""The name of the person."""
age: int
"""The age of the person."""
def foo(**p: Unpack[Person]):
print(p['age'])
foo(name="John", age=30)
Hovering over name would show "The name of the person." on the last line
it doesn't just happen with Unpack
Code sample in basedpyright playground
from typing import TypedDict
class Person(TypedDict):
name: str
"""The name of the person."""
age: int
"""The age of the person."""
person = Person(name="John", age=30)
person['age'] # no docstring on hover
looks like my example will be addressed in #1533
another thing: any plan of something like "go to definitions" working on literal key (subscript)?
could you provide an example? go to definition on TypedDict keys works for me now
could you provide an example? go to definition on
TypedDictkeys works for me now
@DetachHead oops sorry. I'm recently working on a project that uses pylance which does not have the capability. I just know basedpyright has already supported it.