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

Fix parsing of units string with same canonalized name #1476

Merged
merged 1 commit into from
Mar 28, 2022

Conversation

jules-ch
Copy link
Collaborator

@jules-ch jules-ch commented Mar 1, 2022

@keewis keewis mentioned this pull request Mar 2, 2022
21 tasks
Copy link
Contributor

@keewis keewis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good to me

self,
input_string: str,
as_delta: bool = True,
case_sensitive: Optional[bool] = None,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as far as I can tell (I don't really use type hints myself), in newer versions of python, type hints with = None imply Optional:

Suggested change
case_sensitive: Optional[bool] = None,
case_sensitive: bool = None,

@jules-ch
Copy link
Collaborator Author

Mypy support implicit Optional but explicit is prefered.

https://stackoverflow.com/questions/62732402/can-i-omit-optional-if-i-set-default-to-none

@hgrecco
Copy link
Owner

hgrecco commented Mar 28, 2022

Looks good to me!

@jules-ch
Copy link
Collaborator Author

Thanks for the quick review !

@jules-ch jules-ch merged commit ce33927 into hgrecco:master Mar 28, 2022
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.

Unit object gives wrong unit when mixing aliases
3 participants