-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve interoperability of TimeSpan dates.
Attributes 'start_date' and 'end_date' must return a normal Python `datetime.date`:class: instance under normal operation. Returning an Infinity-comparable type should be regarded as an internal implementation hack to facilitate the implementation of `__and__` and `__or__`. This allows normal code to do math with `start_date` and `end_date`. For instance:: >>> from datetime import date >>> date.today() - timespan.start_end That could fail in Python 2.7 because 'date' would not interoperate with the subtype returned by 'start_date'.
- Loading branch information
Showing
2 changed files
with
52 additions
and
9 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