Visitar URL original
bpo-33783: Use proper class markup for random.Random docs by Carreau · Pull Request #7817 · python/cpython · GitHub
The Wayback Machine - https://web.archive.org/web/20260216202528/https://github.com/python/cpython/pull/7817
Skip to content
/ cpython Public

bpo-33783: Use proper class markup for random.Random docs#7817

Merged
vstinner merged 4 commits intopython:masterfrom
Carreau:bpo-33783
Apr 16, 2019
Merged

bpo-33783: Use proper class markup for random.Random docs#7817
vstinner merged 4 commits intopython:masterfrom
Carreau:bpo-33783

Conversation

@Carreau
Copy link
Contributor

@Carreau Carreau commented Jun 20, 2018 •

This should make it easier to spot the existence of this class

https://bugs.python.org/issue33783

Copy link
Member

Choose a reason for hiding this comment

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

We don't require a NEWS entry for small documentation patches.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I know, but then bedevere/news mark the test as failing, in the all-PR view of GitHub the test appear as failing and then the PRs tends to not be reviewed... removed.

Copy link
Member

Choose a reason for hiding this comment

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

Style nit: Please follow the existing style in Doc/library/random.rst and use 3-space indentation.

Copy link
Contributor

Choose a reason for hiding this comment

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

Other than berker's nits, this looks fine and is ready to apply. I added backport tags as well.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oops, yes, nice catch. done, and vimrc updated accordingly to not do that again.

@Carreau
Copy link
Contributor Author

Carreau commented Jun 21, 2018

Comments addressed, ready for review.


.. class:: Random([seed])

Class to be subclassed if you want to use a different basic generator of your
Copy link
Contributor

Choose a reason for hiding this comment

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

This wording suggests to me that the class is only useful as a base class for subclassing, whereas I think it's also useful to instantiate and use directly.

@Carreau
Copy link
Contributor Author

Carreau commented Jun 21, 2018 via email

@takluyver
Copy link
Contributor

Oh, I'd missed that it was just moving a paragraph. Still, where the paragraph was before, there's a sentence just above it about instantiating Random, and then that paragraph says it can also be subclassed. The new arrangement separates those ideas, and if you only see the class description, it looks a bit like subclassing is the only option.

@Carreau
Copy link
Contributor Author

Carreau commented Jun 22, 2018

I still see that as part as the module introduction, you can have multiple instance of this module by creating Random instances. I can re-add that to the class description but I dont' think it should be removed from the the top introduction.

@Carreau
Copy link
Contributor Author

Carreau commented Jun 22, 2018

How's that ? Ive re-added the information in the class description.

@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.

And if you don't make the requested changes, you will be poked with soft cushions!

@Carreau
Copy link
Contributor Author

Carreau commented Jun 24, 2018

I have made the requested changes; please review again

@bedevere-bot
Copy link

Thanks for making the requested changes!

@rhettinger: please review the changes made to this pull request.

@serhiy-storchaka serhiy-storchaka added the docs Documentation in the Doc dir label Dec 8, 2018

.. class:: Random([seed])

This class implement the default pseudo-random number generator used by the
Copy link
Contributor

Choose a reason for hiding this comment

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

Replace "This class implement" with "Class that implements"

@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.

@vstinner
Copy link
Member

I removed the " needs backport to 3.6" label, the 3.6 branch no long accept bugfixes (only security fixes are accepted): https://devguide.python.org/#status-of-python-branches

Carreau and others added 4 commits March 12, 2019 17:47
This should make it easier to spot the existence of this class

Signed-off-by: Matthias Bussonnier <bussonniermatthias@gmail.com>
Just use a class stub for `Random` indicating it implements the default
PRNG.
@Carreau
Copy link
Contributor Author

Carreau commented Mar 12, 2019

I have made the requested changes; please review again

@bedevere-bot
Copy link

Thanks for making the requested changes!

@rhettinger: please review the changes made to this pull request.

Copy link
Member

@vstinner vstinner left a comment

Choose a reason for hiding this comment

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

LGTM.

@rhettinger: Would you mind to review the update PR?

@Carreau
Copy link
Contributor Author

Carreau commented Mar 15, 2019

Thanks @vstinner for the review. Looking forward for this being merge, I originally hopped it would not take that much time from core developers.

@csabella csabella requested a review from rhettinger April 10, 2019 23:15
@vstinner vstinner merged commit 31e8d69 into python:master Apr 16, 2019
@miss-islington
Copy link
Contributor

Thanks @Carreau for the PR, and @vstinner for merging it 🌮🎉.. I'm working now to backport this PR to: 3.7.
🐍🍒⛏🤖

@vstinner
Copy link
Member

Hum, @miss-islington has some troubles to create the backport. Anyway, it might be worth it to check if the doc is generated as expected at https://docs.python.org/dev/library/random.html before merging a 3.7 backport :-)

@vstinner
Copy link
Member

Ah, PR #12859 is the 3.7 backport.

vstinner pushed a commit that referenced this pull request Apr 16, 2019
…H-12859)

Signed-off-by: Matthias Bussonnier <bussonniermatthias@gmail.com>
(cherry picked from commit 31e8d69)

Co-authored-by: Matthias Bussonnier <bussonniermatthias@gmail.com>
@Carreau Carreau deleted the bpo-33783 branch October 20, 2025 13:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Documentation in the Doc dir skip news

Projects

None yet

Development

Successfully merging this pull request may close these issues.

10 participants