Repository navigation
show RuntimeWarning if super init raises TypeError - #177
Merged
Merged
Conversation
Since we are now passing unused constructor args to `super().__init__`, improper arguments that were being silently ignored will raise. This shows a warning in that case, so that downstream bugs have a release cycle to fix their bugs revealed by the change.
Member
|
sigh on Python 2, object itself issues a warning instead of raising in this same situation, so the test is failing there with: |
Member
Author
|
Le sigh... |
takluyver
added a commit
that referenced
this pull request
Feb 17, 2016
show RuntimeWarning if super init raises TypeError
| super(HasTraits, self).__init__(*super_args, **super_kwargs) | ||
| except TypeError as e: | ||
| arg_s_list = [ repr(arg) for arg in super_args ] | ||
| for k, v in kwargs.items(): |
Member
There was a problem hiding this comment.
This should be super_kwargs instead of kwargs (sorry, didn't spot this until after merging)
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Since we are now passing unused constructor args to
super().__init__, improper arguments that were being silently ignored will raise.This shows a warning in that case, so that downstream bugs have a release cycle to fix their bugs revealed by the change.
I decided to use RuntimeWarning instead of a DeprecationWarning because anything that causes this was always a bug, it was just a silently ignored bug and silence is bad.
closes #176