-
Notifications
You must be signed in to change notification settings - Fork 9
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
Improve typed interface of calculate_implied_probabilities()
#4
Comments
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. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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:The text was updated successfully, but these errors were encountered: