Skip to content
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

Type hints on varargs and kwargs that take anything should be Any. #11950

Merged
merged 1 commit into from
Oct 18, 2023

Conversation

obi1kenobi
Copy link
Collaborator

Type hinting *args as List[Any] means that each positional argument should be a list. Type hinting **kwargs as Dict[str, Any] means that each keyword argument should be a dict of strings.

This is almost never what we actually wanted, and doesn't seem to be what we want in any of the cases I'm replacing here.

@vercel
Copy link

vercel bot commented Oct 17, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Ignored Deployment
Name Status Preview Comments Updated (UTC)
langchain ⬜️ Ignored (Inspect) Visit Preview Oct 17, 2023 9:28pm

@dosubot dosubot bot added Ɑ: agent Related to agents module 🤖:improvement Medium size change to existing code to handle new use-cases labels Oct 17, 2023
@eyurtsev eyurtsev merged commit 392df7b into master Oct 18, 2023
@eyurtsev eyurtsev deleted the pg/fix-typehints-on-varargs-and-kwargs branch October 18, 2023 01:31
hoanq1811 pushed a commit to hoanq1811/langchain that referenced this pull request Feb 2, 2024
…angchain-ai#11950)

Type hinting `*args` as `List[Any]` means that each positional argument
should be a list. Type hinting `**kwargs` as `Dict[str, Any]` means that
each keyword argument should be a dict of strings.

This is almost never what we actually wanted, and doesn't seem to be
what we want in any of the cases I'm replacing here.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Ɑ: agent Related to agents module 🤖:improvement Medium size change to existing code to handle new use-cases
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants