-
Notifications
You must be signed in to change notification settings - Fork 0
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 Monetary API, Various Chores #19
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Instead of `pass` we use Python ellipsis (`...`) to make `pyright` happy.
`pyright` keeps complaining about `money` not being a property. `mypy` does not. The rationale of `pyright` developers seem to be right: microsoft/pyright#2601 (comment)
Looks like min/max and iterable of iterables cause a false positive with pyright. This is most likely due to that `pyright` is picking the wrong overloaded function signature.
Initially, we are disabling a bunch of checks. We will enable them as we fix them.
Fixed: - too-many-lines - redefined-builtin - line-too-long - consider-using-in Disabled: - duplicate-code
For safety and style purposes, `{Money,Price}.NA` is renamed to `{Money,Price}.na` and made a classmethod.
This is not really affecting the runtime behaviour. However, type checking and intellisense will complain about that these properties may not exist on Money/Price object. For call-sites: Type guards or `isinstance` might work well to "cast" to some/none money/price instance.
Closed
17 tasks
fkoksal
approved these changes
Jun 14, 2023
- We want to locally disable some errors. - Disable "suppressed-message" as we may disable some errors.
- Uses "PEP 647 – User-Defined Type Guards" - Depends on `typing_extensions` for Python versions <3.10 - Increased pylint max-module-lines setting
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Closes #18.
/.vscode
directoryNonePrice.money
a property{Money,Price}.qty_or_zero
method{Money,Price}.qty_or_none
method{Money,Price}.qty_or_else
method{Money,Price}.qty_map
method{Money,Price}.fmap
method{Money,Price}.dimap
method{Money,Price}.ccy_or_none
method{Money,Price}.dov_or_none
method{Money,Price}.or_else
method{Money,Price}.{defined,undefined}
properties{Money,Price}.NA
a classmethod, rename to .na{Money,Price}.{ccy,qty,dov}
type hints