Open peterschutt opened 5 months ago
Sounds good - might I suggest as per discussion on #2 that this current issue widens in scope to include all of the changes you feel are appropriate to get the package in good shape for mypy including incorporating it into CI
Great, thanks. I will open a PR for this stuff over the next day or so.
The function has a boolean flag argument that alters its output so we can use
@overload
to specify the relationship between args and output types.For example,
with 0.1.1 branch:
Using overloads, that can be:
... which is a much nicer experience downstream as we don't need to narrow the return type somehow before we go on to use it.
LMK if this is something you'd be interested in a PR for.. there is potentially a lot of overloads required as all of the arguments can be specified either positionally or by kwarg and mypy requires an overload that covers any scenarios. E.g., here is the diff that I've got to produce the above:
The number of overloads could be reduced by making the args other than
odds
keyword only, which would be an OK fit IMO: