-
Notifications
You must be signed in to change notification settings - Fork 71
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
Adding annotations - triangle.py #522
base: master
Are you sure you want to change the base?
Conversation
|
@genedan how about @MatthewCaseres is that actually an issue? The argument is not always used. Do you think that will cause confusion? I guess we could do |
@kennethshsu Some arguments don't describe themselves as optional, but since they have a default |
According to PEP 484 we need some explicit annotation to indicate a parameter is optional: I'm thinking we could do something like:
or
I would prefer the former since it's more explicit that the parameter is optional. |
This looks really good, I like it a lot! To @MatthewCaseres's point, I think we can do a better job with input validation. I'll add this to my backlog. |
On second look, I thought this is for the docstrings, not the actual declaration in the code. But good still! |
What other types can be accepted for the So I was thinking the accepted type for |
In the pandas source code, they annotate the input as
|
I'm mostly adding things like comments and type hints. Also fixes that would make the code compliant with PEP guidelines.