-
-
Notifications
You must be signed in to change notification settings - Fork 73
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
Date and datetime #348
Date and datetime #348
Conversation
This looks great to me. @jbednar @jlstevens Any objections? |
(Merged the first two commits) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This all looks good to me. I can't see any problems with backwards compatibility, and this is a much better approach going forwards. I'm happy for it to be merged once the above minor docs issues are either addressed or resolved as not relevant. Thanks so much for submitting this, and I'm sorry for having taken so long to review it (blame SciPy2019 and all of its amazingness!).
If this change is merged I'm not sure it makes sense to allow import datetime
import param
class Foo(param.Parameterized):
p = param.DateTime()
foo = Foo()
foo.p = datetime.date.today()
print(repr(foo.p)) # => datetime.date(2019, 7, 25) Changing this would be a breaking change however. |
Fixed the documentation of the changes which has some confusing regarding datetime vs date, etc. |
Another solution would be to keep |
Updated to this alternative proposition:
I'd be tempted to add (in other PRs):
|
Date and DateRange as kepts for hybrid date/datetime for compatibility.
Thanks @randomstuff! Sorry for the long review cycle. This is hugely appreciated. |
I was looking of the different As a consequence, Conclusion:
|
Date and DateRange as kepts for hybrid date/datetime for compatibility.
Rename
Date
intoDateTime
and addCalendarDate
(fordate
).Same for
DateRange
.For compatiblity
Date
is an alias forDateTime
. The idea is to renameCalendarDate
intoDate
later on.see #346 and #168