Fix issue with ABC-derived classes having their members ignored in Python 3#53
Merged
astrofrog merged 1 commit intoastropy:masterfrom Nov 1, 2018
Merged
Conversation
Member
|
@jairideout - thanks for the PR! It looks like tests are failing on Python 2.7 - since we are still Python 2 compatible (for now), could you see if there is an easy fix? |
…thon 3 ABC-derived classes (i.e. those deriving from the `abc` and `collections.abc` modules) now include their members (as defined in `__dict__`) in generated `autosummary` RST. `__slots__` may still be used to override `__dict__`, but if an ABC-derived class has empty slots, its `__dict__` will be used instead. This was only an issue in Python 3 when ``:inherited-members:`` was not in effect. Fixes astropy#52
Contributor
Author
|
Thanks for the heads up @astrofrog -- I amended my commit to add Python 2.7 support and the tests are now passing. I'm not sure what's going on with the drop in coverage (-0.9%). Let me know if that's something I should investigate further. Note: while adding Python 2.7 support, I noticed that the bug was only an issue in Python 3 when Thanks for taking a look! |
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.
ABC-derived classes (i.e. those deriving from the
abcandcollections.abcmodules) now include their members (as defined in__dict__) in generatedautosummaryRST.__slots__may still be used to override__dict__, but if an ABC-derived class has empty slots, its__dict__will be used instead.This was only an issue in Python 3 when
:inherited-members:was not in effect.Fixes #52