Skip to content

Conversation

@vrpolakatcisco
Copy link

@vrpolakatcisco vrpolakatcisco commented Apr 12, 2019

@bedevere-bot bedevere-bot added the docs Documentation in the Doc dir label Apr 12, 2019
@the-knights-who-say-ni

This comment was marked as resolved.

@vrpolakatcisco

This comment was marked as resolved.

@vrpolakatcisco
Copy link
Author

bedevere/news — News entry found in Misc/NEWS.d

I fail at blurb. How can I fix?

@vrpolakatcisco

This comment was marked as resolved.

@MakDon
Copy link
Contributor

MakDon commented Jun 10, 2019

Hi, @vrpolakatcisco ,it is no need to add a 'skip news' in Misc/NEWS.d. A core dev would review your commit and add a 'skip news' tag on the PR.
I haven't checked the document yet. I will check it later.

@vrpolakatcisco
Copy link
Author

vrpolakatcisco wants to merge 2 commits into python:master from vrpolakatcisco:fixtures_doc

Well, my plan was to do a clean rebase. Not sure what to do with the "sync" merge commit.

Copy link
Member

@JulienPalard JulienPalard left a comment

Choose a reason for hiding this comment

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

Thanks for trying to enhance the documentation! I propose to simplify further, as it's only normal rules.

Copy link
Member

Choose a reason for hiding this comment

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

Same, what are you trying to clarify? As said in b.p.o normal inheritance rules apply. I think we should be explicit about inheritance only when "anormal rule apply", not every time "normal" rules apply.

Copy link
Author

Choose a reason for hiding this comment

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

The original formulation
"These must be implemented as class methods"
sounds like normal rules do not apply for some reason, and each class needs to have an implementation (even if it only calls ancestor implementation).

Copy link
Member

Choose a reason for hiding this comment

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

sounds like normal rules do not apply for some reason

Yes, it tells it's not a method but a class method, it reminds you not to forgot to add the @classmethod, the original wording is OK.

and each class needs to have an implementation (even if it only calls ancestor implementation)

Can you proove it with an example?

Copy link
Member

Choose a reason for hiding this comment

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

Same here, let's not be explicit about this being normal (if we're explicit here about the inheritance working normally, why not adding it everywhere else on the doc? No.)

Copy link
Author

Choose a reason for hiding this comment

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

The original formulation
"you must call up to them yourself"
once again sounds like normal rules do not apply for some reason, and you have to make the call explicit, instead of relying on inheritance.

if we're explicit here about the inheritance working normally, why not adding it everywhere else on the doc?

I agree that confirming something is normal creates doubts on other (not explicitly confirmed things).

I am going to propose different edits, focusing on just removing the "wrong sounding" formulations.

Copy link
Member

Choose a reason for hiding this comment

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

once again sounds like normal rules do not apply for some reason

I agree.

and you have to make the call explicit, instead of relying on inheritance

Inheritance never "call implicitly", as long as you re-implement the method, you have to call the parent implementation manually. But if you don't implement a method, the parent one is just inherited and no manual actions are needed. Only normal rules here.

@bedevere-bot
Copy link

A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated.

Once you have made the requested changes, please leave a comment on this pull request containing the phrase I have made the requested changes; please review again. I will then notify any core developers who have left a review that you're ready for them to take another look at this pull request.

@methane
Copy link
Member

methane commented Sep 12, 2019

FYI, merge master is enough because we use "Squash and merge" workflow.
Merge commits created by "merge master" command are not merged into the master branch.

Copy link
Member

Choose a reason for hiding this comment

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

Why removing the "if there is one"? It was right:

tearDownClass = getattr(previousClass, 'tearDownClass', None)
if tearDownClass is not None:
    ...

I don't see any problem with this paragraph, and it looks not correlated with bpo-36612.

Copy link
Member

Choose a reason for hiding this comment

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

Looks unrelated to the issue, and I don't see how the new wording helps.

Copy link
Member

Choose a reason for hiding this comment

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

I prefer the original wording.

Copy link
Author

Choose a reason for hiding this comment

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

Not sure why module functions have "should" and class methods have "must", but I think I can make do edits also without affecting these two lines.

Copy link
Member

Choose a reason for hiding this comment

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

This sentence is right, the implementations are present but empty. But now without context I don't see the point of mentioning it, why not removing it all?

Copy link
Author

Choose a reason for hiding this comment

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

I will expand in next version.

Copy link
Member

Choose a reason for hiding this comment

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

Honestly this still doesn't sound very useful to me. The new text doesn't really answer the question in the original bug report.

The previous formulations could suggest
that some special rules apply for the class methods
as opposed to the normal inheritance rules.

The formulations are tweaked by this patch,
hinting the normal inheritance rules indeed apply.

Sentences describing module functions are also tweaked,
to signify the logic (almost) the same as for class methods.

Signed-off-by: Vratko Polak <[email protected]>
``tearDownModule`` are run.

The abovementioned calls are only executed,
if the corresponding method or function is found.
Copy link
Author

Choose a reason for hiding this comment

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

Choosing "method is found", instead of "method exists" or "class has a method", in order to hint method resolution order is in effect.

then you must call up to them yourself. The implementations in
:class:`TestCase` are empty.
The implementations in :class:`TestCase` are present, but empty.
That means the implemenation is executed for classes descending from
Copy link
Author

Choose a reason for hiding this comment

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

Choosing "descending" instead of "derived" or "child", to suggest the inheritance graphs can be complicated.

:class:`TestCase` are empty.
The implementations in :class:`TestCase` are present, but empty.
That means the implemenation is executed for classes descending from
:class:`TestCase`, but the implementation does not do anything,
Copy link
Author

Choose a reason for hiding this comment

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

Empty implementation executed means no special handling is there to interfere with normal inheritance rules.

@AlexWaygood AlexWaygood changed the title bpo-36612: Edit unittest.rst on SetUpClass calls gg-80793: Edit unittest.rst on SetUpClass calls Oct 30, 2022
@AlexWaygood AlexWaygood changed the title gg-80793: Edit unittest.rst on SetUpClass calls gh-80793: Edit unittest.rst on SetUpClass calls Oct 30, 2022
@willingc willingc added the pending The issue will be closed if no feedback is provided label Oct 31, 2024
@willingc
Copy link
Contributor

This PR has been languishing. I'm going to go ahead and close the PR and associated issue.

Thanks @vrpolakatcisco for the report and the PR.

@willingc willingc closed this Oct 31, 2024
@AA-Turner AA-Turner removed the pending The issue will be closed if no feedback is provided label Apr 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting changes docs Documentation in the Doc dir skip news

Projects

Status: Todo

Development

Successfully merging this pull request may close these issues.