Skip to content

Also remove super arguments in rst files#6629

Merged
mhvk merged 2 commits into
astropy:masterfrom
MSeifert04:super_noarg_docs
Oct 1, 2017
Merged

Also remove super arguments in rst files#6629
mhvk merged 2 commits into
astropy:masterfrom
MSeifert04:super_noarg_docs

Conversation

@MSeifert04

Copy link
Copy Markdown
Contributor

Like #6613 but I forgot to change the .rst files there...

@astropy-bot

astropy-bot Bot commented Sep 30, 2017

Copy link
Copy Markdown

Hi there @MSeifert04 👋 - thanks for the pull request! I'm just a friendly 🤖 that checks for issues related to the changelog and making sure that this pull request is milestoned and labelled correctly. This is mainly intended for the maintainers, so if you are not a maintainer you can ignore this, and a maintainer will let you know if any action is required on your part 😃.

Everything looks good from my point of view! 👍

If there are any issues with this message, please report them here

Comment thread docs/nddata/subclassing.rst Outdated
... # Call the setter of the super class in case it might contain some
... # important logic (only True for meta, unit and uncertainty)
... super(NDDataUncertaintyShapeChecker, self.__class__).uncertainty.fset(self, value)
... NDData.uncertainty.fset(self, value)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note that you can't easily use super when just overriding the setter of a property. This is probably better than using self.__class__ as second argument... At least it's shorter and doesn't look like a bug waiting to happen.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If @mwcraig approves this, I don't see a problem with the rest. Thanks!

@MSeifert04 MSeifert04 Sep 30, 2017

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I'm wondering if I shouldn't revert that one again. Hardcoding the superclass also has it's drawbacks because it breaks the MRO...

But on the other hand it already uses @NDData.uncertainty.setter as decorator so it will probably (untested) break the MRO anyway...

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This indeed feels very hacky. My tendency would be to leave it in place for this PR (which looks all OK apart from this), and open a separate issue about it (unless @mwcraig has an immediate answer).

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't have a better solution...except perhaps removing the example 😉. (I know, not really an option) Opening a separate issue in a moment.

Comment thread docs/nddata/subclassing.rst Outdated
... # Call the setter of the super class in case it might contain some
... # important logic (only True for meta, unit and uncertainty)
... super(NDDataUncertaintyShapeChecker, self.__class__).uncertainty.fset(self, value)
... NDData.uncertainty.fset(self, value)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't have a better solution...except perhaps removing the example 😉. (I know, not really an option) Opening a separate issue in a moment.

@MSeifert04

MSeifert04 commented Oct 1, 2017

Copy link
Copy Markdown
Contributor Author

I reverted the problematic change. Better to let it as-is than to provide a similar messy way.

@mhvk

mhvk commented Oct 1, 2017

Copy link
Copy Markdown
Contributor

Looks all OK now, so merging. Thanks, @MSeifert04!

@mhvk mhvk merged commit 257f753 into astropy:master Oct 1, 2017
@MSeifert04 MSeifert04 deleted the super_noarg_docs branch October 1, 2017 21:16
@pllim

pllim commented Oct 2, 2017

Copy link
Copy Markdown
Member

@MSeifert04 , I think you have unlocked the "super cleaner" achievement. 🏅

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants