Skip to content
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

Bad TraitListEvent from ListStrEditor and TabularEditor #791

Closed
mdickinson opened this issue Apr 27, 2020 · 1 comment · Fixed by #875
Closed

Bad TraitListEvent from ListStrEditor and TabularEditor #791

mdickinson opened this issue Apr 27, 2020 · 1 comment · Fixed by #875
Assignees
Milestone

Comments

@mdickinson
Copy link
Member

mdickinson commented Apr 27, 2020

The ListStrEditor and TabularEditor create TraitListEvents with removed and added reversed. See:

event = TraitListEvent(0, added, removed)

and:

list_event = TraitListEvent(0, added, removed)

The signature of the TraitListEvent initializer is

def __init__ ( self, index = 0, removed = None, added = None ):

To avoid similar errors in the future, I recommend passing these arguments by keyword instead of by position. I think we should also make them keyword-only in Traits.

I'd mark this with "Good first issue", except that I think writing the tests may be nontrivial.

@mdickinson
Copy link
Member Author

Note: the equivalent wx code has things in the right order, but could also be changed to pass by keyword instead of by position.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants