forked from beancount/beancount
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use
Optional[T]
instead of T | None
for Python 3.9 compatibility
While most typing annotations are consumed only by type checkers, a handful of them provide information that can be useful at runtime. For example, beanquery uses typing annotations for the fields of the named tuples holding ledger directive represenations derive table column types. Make sure that these typing annotations can be interpreted in all supported Python versions. This requires converting some use of the `T | None` form to `Optional[T]`. Add a test to avoid regressions.
- Loading branch information
Showing
2 changed files
with
30 additions
and
14 deletions.
There are no files selected for viewing
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
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