-
Notifications
You must be signed in to change notification settings - Fork 85
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
Deprecate None values for Date, Datetime and Time trait types #1444
Deprecate None values for Date, Datetime and Time trait types #1444
Conversation
…e-and-none-values-for-date-traits
@@ -44,7 +44,7 @@ class HasTimeTraits(HasStrictTraits): | |||
none_allowed = Time(allow_none=True) | |||
|
|||
|
|||
class TestDatetime(unittest.TestCase): | |||
class TestTime(unittest.TestCase): |
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.
Drive-by copypasta fix, unrelated to the main purpose of the PR
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.
LGTM with one minor question. We already have the issue regd documenting Date
, Datetime
and Time
so there's no documentation changes that need to be made in this PR.
Just to confirm, can there be any issues rewriting the traits as subclasses of TraitType
instead of using BaseInstance
?
Finally, how do we plan to track the work needed for traits 7.0.0? Do we want to create an issue now/a milestone?
Yes. There are potential behaviour changes here, but mostly in a good direction: that is, treating an instance of For example, if anyone is "instantiating" But I checked existing code (to the extent that that code was available to me) for usage patterns, and I would expect the vast majority of existing code to be unaffected by this change (beyond the intentional part of the change - the new |
The milestone already exists, and has done for some time. I already have an issue in that milestone as a reminder to review deprecations. |
|
This PR builds on #1441 to also deprecate acceptance of
None
values forDate
traits. While I think this is the right way to go,this does introduce a discrepancy with theDatetime
andTime
classes, whereNone
is still accepted by default with no deprecation warning issued.Update: the PR has been extended to cover
Datetime
andTime
classes; this required realising theDatetime
andTime
trait types (so that they're no longer instances ofBaseInstance
).Closes #1438
Checklist
docs/source/traits_api_reference
) (relevant docstrings updated)Update User manual (N/Adocs/source/traits_user_manual
)traits-stubs