Add an opt-in hover/signature expansion for **kwargs: Unpack[TypedDict] #7958
Replies: 2 comments
-
|
Hi @Erlonealpha, I'm an AI Support assistant here to help with your issue. While the team reviews your request, I wanted to provide some possible tips and documentation that might help you in the meantime. Similar Issues (FYI only, not solutions) The following issues may or may not be related to your request. They are provided for reference only, as they may describe similar concerns about hover/signature formatting, but may not be the same feature request.
The team will respond to your issue shortly. Please note this is a trial feature and may not be fully accurate. I hope these suggestions are helpful in the meantime. If this comment helped you, please give it a 👍. If the suggestion was not helpful or was incorrect, please give it a 👎. Your feedback helps us improve! |
Beta Was this translation helpful? Give feedback.
-
|
Thanks for the suggestion. Transferring to discussion items for up votes. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Title
Add an opt-in hover/signature expansion for
**kwargs: Unpack[TypedDict]Summary
Please add an optional setting that expands function signatures using
**kwargs: Unpack[TypedDict]in hover and signature help.For example, instead of showing:
show an expanded form such as:
when
Optionsis aTypedDictlike:Motivation
Unpack[TypedDict]keeps source code concise, but hover text hides the effective callable interface.When reading an API, users often want to see the accepted keyword names immediately, without having to jump to the
TypedDictdefinition or manually expand it.This is especially useful for:
TypedDictWhy this request is narrower than discussion #2715
There is already a broader discussion about showing expanded types rather than aliases in hover:
#2715
This request is much narrower:
**kwargs: Unpack[TypedDict]That makes it a more targeted and potentially more manageable feature.
Example
Current hover/signature display:
Requested hover/signature display when the option is enabled:
Proposed behavior
Please add an opt-in setting for hover and/or signature help that expands
**kwargs: Unpack[TypedDict]into explicit keyword parameters.Possible behavior:
TypedDict, they could be displayed accordinglyScope
To keep the feature predictable, the initial scope could be limited to:
Unpack[SomeTypedDict]It does not need to solve:
Benefit
This would make APIs using
Unpack[TypedDict]much easier to inspect in practice, while keeping the feature small, optional, and focused.Beta Was this translation helpful? Give feedback.
All reactions