Skip to content

Replace kwargs:dict with kwargs:any #697

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

c-w-feldmann
Copy link

In the code kwargs are typed as dict.
According to the python typing manual:

At runtime, the type of a variadic positional parameter (*args) is a tuple, and the type of a variadic keyword parameter (**kwargs) is a dict. However, when annotating these parameters, the type annotation refers to the type of items within the tuple or dict (unless Unpack is used).
Source

This PR adapts the type hints accordingly.

Copy link
Collaborator

@tpgillam tpgillam left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the contribution! I agree that this is more correct.

@blankjul might want to have final sign-off on merging.

@@ -357,7 +357,7 @@ def _sample(
def get(
*args: Tuple[Union[Variable,object],...],
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the same change can be made here as you made further above for *keys.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants