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

use observe in traitlets.config #149

Merged
merged 1 commit into from
Dec 18, 2015
Merged

Conversation

minrk
Copy link
Member

@minrk minrk commented Dec 17, 2015

instead of deprecated APIs

instead of deprecated APIs
@minrk minrk added this to the 4.1 milestone Dec 17, 2015
This was referenced Dec 17, 2015
@minrk
Copy link
Member Author

minrk commented Dec 18, 2015

This has already broken the IPython kernel. I need to make sure to update this such that _config_changed accepts both the @observe and pre-@observe signatures.

@SylvainCorlay
Copy link
Member

It is clear that if someone registers @observe('_foo_changed') and you override the method in derived classes, the overridden method will not be called. Do you want to give priority to the old API in the implementation so that whenever we have a _foo_changed method, it is called with priority over the registered one?

@minrk
Copy link
Member Author

minrk commented Dec 18, 2015

For this to be valid as 4.1, we need Configurable subclasses that have something like:

def _config_changed(self, name, old, new):
    ...
    super()._config_changed(name, old, new)

to work exactly as before. This should also work in such a way that the base Configurable class doesn't produce any DeprecationWarnings for having _config_changed defined (it's fine for the downstream case to produce the warning if the method isn't decorated).

@SylvainCorlay SylvainCorlay merged commit aa6d882 into ipython:master Dec 18, 2015
@minrk minrk deleted the config-observe branch December 18, 2015 17:19
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.

None yet

2 participants