Skip to content
This repository has been archived by the owner on Oct 4, 2024. It is now read-only.

add support for _ default key #35

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

Conversation

ethanabrooks
Copy link

In reference to #34

Copy link
Owner

@jspahrsummers jspahrsummers left a comment

Choose a reason for hiding this comment

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

Thanks for the pull request! Could you please add a test demonstrating how to use this?

@ethanabrooks
Copy link
Author

done!

@ethanabrooks
Copy link
Author

Hmmm I took a look at the typechecker, but it wasn't exactly clear how to add _ to the list of valid keyword arguments. Could you lend some guidance on that front?

@jspahrsummers
Copy link
Owner

Thanks for the test! It's been a while since I've hacked on the codebase myself, to be honest, but at a high level it would involve telling the typechecker about your new argument to match.

The tricky part that I foresee here is that the type of _ is quite open-ended (probably something like Callable[..., _MatchResult]). I'm not sure what mypy's API for that looks like, but it would look broadly similar to how we instantiate the other mypy.types.CallableTypes.

Hope that helps.

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

Successfully merging this pull request may close these issues.

2 participants