-
-
Notifications
You must be signed in to change notification settings - Fork 17
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
Make DateTimeRange hashable #39
Comments
Thank you for your feedback.
|
Good point. Since |
This is true. However, I believe Implementation of
This hash output will be change if from datetimerange import DateTimeRange
time_range = DateTimeRange.from_range_text("2015-03-22T10:00:00+0900 - 2015-03-22T10:10:00+0900")
print(hash(time_range))
time_range.set_end_datetime("2016-03-22T10:10:00+0900")
print(hash(time_range))
|
I understand, that's why I proposed the idea to make |
I still would prefer to approach that creates an immutable
because these approaches will break the backward compatibility of |
Implement
__hash__
function onDateTimeRange
to be able to use it, for example, in combination with the decorator@lru_cache
.The text was updated successfully, but these errors were encountered: