Skip to content

Fix overriding _trait_default method#436

Merged
minrk merged 5 commits intoipython:masterfrom
minrk:test-override-magic-method
Aug 10, 2017
Merged

Fix overriding _trait_default method#436
minrk merged 5 commits intoipython:masterfrom
minrk:test-override-magic-method

Conversation

@minrk
Copy link
Member

@minrk minrk commented Aug 10, 2017

Registering generators during class initialization prevents overriding these after the fact.
Move the logic to default resolution, rather than explicitly registering on every construction,
which doesn't allow expected behavior when modifying class or instance objects.

minrk added 5 commits August 10, 2017 12:00
`has_trait` function is not defined
Prevents modifying classes from behaving as expected

- magic method has highest priority, if defined
- truncate mro walk at trait.this_trait
@minrk minrk force-pushed the test-override-magic-method branch from 1f14c60 to 036a909 Compare August 10, 2017 11:31
@minrk minrk merged commit 62183d9 into ipython:master Aug 10, 2017
@minrk minrk deleted the test-override-magic-method branch August 10, 2017 11:43
@Carreau Carreau added this to the 5.0 milestone Jun 4, 2020
@Carreau Carreau added 5.0-re-review Need to re-review for potential API impact changes. 5.0-major Major change in 5.0 need proper documentation labels Jun 4, 2020
@Carreau Carreau added 5.0-no-incidence change that has noincidence on 5.0 compat (eg: doc) and removed 5.0-major Major change in 5.0 need proper documentation 5.0-re-review Need to re-review for potential API impact changes. labels Jun 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

5.0-no-incidence change that has noincidence on 5.0 compat (eg: doc)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants