Make NoDefaultSpecified and no_default_specified private #1380
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Closes #1379
This PR fixes the issue by making
NoDefaultSpecified
andno_default_specified
private by naming convention. We believe they are not (actively) used outside of traits. If they are indeed used, this PR will at least make those breakage fail in a more obvious and trackable fashion, and we will get to know why and how it gets used, and then we can fix the breakage accordingly.Note that if I change this line to
if True:
:traits/traits/trait_type.py
Line 297 in a68bc50
I would get a test failure for the test that involves TraitsUI:
Instead of relying on this test which really belonged to TraitsUI, I added another one that would fail for the same reason.
Ideally there should be a test for
TraitType.clone
, but I struggle to understand how it is supposed to be used. From what I saw, it is predominantly used byTraitType.__call__
and_TraitMaker
. The former is used in the metaclass and the latter is used byTrait
... both are quite complex. Eventually I decided this can be an exercise for another day, the existing usage in TraitsUI deserves a test in Traits anyway and it would provide the protection we needed for the code we changed here.Checklist
docs/source/traits_api_reference
)Update User manual (: This NoDefaultSpecified is not mentioned in the user manualdocs/source/traits_user_manual
)traits-stubs