machow / siuba

Python library for using dplyr like syntax with pandas and SQL
https://siuba.org
MIT License
1.14k stars 48 forks source link

draft: first pass at overloading verb_dispatch #466

Closed machow closed 11 months ago

machow commented 1 year ago

Addresses #465, #418.

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 commented 1 year ago

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 commented 11 months ago

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!