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

getting bound methods requires handler name #153

Merged
merged 1 commit into from
Feb 12, 2016

Conversation

rmorshea
Copy link
Contributor

Retrieving bound methods from event handlers is only valid if their name attribute is not None (i.e. they were registered with @observe). Without checking that name is not None, EventHandler instances registered using HasTraits.observe will fail.

@minrk
Copy link
Member

minrk commented Dec 20, 2015

@rmorshea is there a test we can add?

@SylvainCorlay
Copy link
Member

@rmorshea in which case would we use an EventHandler that is not used as a descriptor?

@rmorshea
Copy link
Contributor Author

@SylvainCorlay, I think you're right - adding a test as if registering unbound event handlers is a feature doesn't seem right. However the error that arises, if you were to use unbound event handlers, isn't indicative of what went wrong, so checking that name is not None still seems like a good idea.

@minrk minrk added this to the 4.1 milestone Jan 11, 2016
@minrk
Copy link
Member

minrk commented Jan 11, 2016

Do we want to merge this (with a confirming test) before 4.1? I think I've done the testing I need for the downstream verifications that we are actually backwards-compatible, so we should be able to release this week. I'm just not sure which side of the release this sits on.

@SylvainCorlay
Copy link
Member

I am fine with this, but I don't think that this should be required.

@minrk minrk modified the milestones: 4.2, 4.1 Jan 13, 2016
minrk added a commit that referenced this pull request Feb 12, 2016
getting bound methods requires handler name
@minrk minrk merged commit 525ec4c into ipython:master Feb 12, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants