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

draft: first pass at overloading verb_dispatch #466

Closed
wants to merge 3 commits into from
Closed

Conversation

machow
Copy link
Owner

@machow machow commented Dec 17, 2022

Addresses #465, #418.

  • Annotates the return type for verb_dispatch as functools._SingleDispatchCallable, so it reflects the behavior of something wrapped in @singledispatch.

Need to remove pylance / mypy type checking errors for code like this:

from siuba import mutate

# Pylance: Expected 1 more positional argument
mutate(a = 1)

@singledispatch
def f(a, b): ...

# No type checking error
f()

@machow
Copy link
Owner Author

machow commented Dec 19, 2022

Alright, adding an explicit type for the cls argument worked. Going to quickly fix the ci build and then will merge in the next day or so!

@machow machow marked this pull request as ready for review December 20, 2022 20:52
@machow
Copy link
Owner Author

machow commented Sep 17, 2023

I use VS Code and type hints a lot now, and have had to deal with situations like this a bit more, so am going to close and take a better pass at this!

@machow machow closed this Sep 17, 2023
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.

1 participant