8000 gh-101100: Fix Sphinx warnings in library/random.rst by hugovk · Pull Request #112981 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

gh-101100: Fix Sphinx warnings in library/random.rst #112981

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 12 commits into from
Dec 28, 2023
Merged
Next Next commit
Fix Sphinx warnings in library/random.rst
  • Loading branch information
hugovk committed Dec 11, 2023
commit 27cc059d49b805bada01b50c8622e408dfbe7902
10 changes: 5 additions & 5 deletions Doc/library/random.rst
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ instance of the :class:`random.Random` class. You can instantiate your own
instances of :class:`Random` to get generators that don't share state.

Class :class:`Random` can also be subclassed if you want to use a different
basic generator of your own devising: in that case, override the :meth:`~Random.random`,
:meth:`~Random.seed`, :meth:`~Random.getstate`, and :meth:`~Random.setstate` methods.
Optionally, a new generator can supply a :meth:`~Random.getrandbits` method --- this
basic generator of your own devising: in that case, override the :meth:`~random.random`,
:meth:`~random.seed`, :meth:`~random.getstate`, and :meth:`~random.setstate` methods.
Optionally, a new generator can supply a :meth:`~random.getrandbits` method --- this
Copy link
Member

Choose a reason for hiding this comment

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

I am not sure that it is right to replace references to Random methods by references to global functions.

@rhettinger, what do you think?

Copy link
Contributor

Choose a reason for hiding this comment

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

@serhiy-storchaka I also think the proposed edit is incorrect.

Copy link
Member Author

Choose a reason for hiding this comment

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

Okay, how's this? 4bbac89

Or should they be separately documented?

allows :meth:`randrange` to produce selections over an arbitrarily large range.

The :mod:`random` module also provides the :class:`SystemRandom` class which
Expand Down Expand Up @@ -409,7 +409,7 @@ Alternative Generator

.. deprecated-removed:: 3.9 3.11
Formerly the *seed* could be any hashable object. Now it is limited to:
:class:`NoneType`, :class:`int`, :class:`float`, :class:`str`,
*NoneType*, :class:`int`, :class:`float`, :class:`str`,
:class:`bytes`, or :class:`bytearray`.

.. class:: SystemRandom([seed])
Expand All @@ -435,7 +435,7 @@ change across Python versions, but two aspects are guaranteed not to change:
* If a new seeding method is added, then a backward compatible seeder will be
offered.

* The generator's :meth:`~Random.random` method will continue to produce the same
* The generator's :meth:`~random.random` method will continue to produce the same
sequence when the compatible seeder is given the same seed.

.. _random-examples:
Expand Down
1 change: 0 additions & 1 deletion Doc/tools/.nitignore
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@ Doc/library/profile.rst
Doc/library/pyclbr.rst
Doc/library/pydoc.rst
Doc/library/pyexpat.rst
Doc/library/random.rst
Doc/library/readline.rst
Doc/library/resource.rst
Doc/library/rlcompleter.rst
Expand Down
0