Skip to content
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

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

Merged
merged 12 commits into from
Dec 28, 2023
14 changes: 7 additions & 7 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`,
hugovk marked this conversation as resolved.
Show resolved Hide resolved
: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 Expand Up @@ -572,14 +572,14 @@ Simulation of arrival times and service deliveries for a multiserver queue::
including simulation, sampling, shuffling, and cross-validation.

`Economics Simulation
<https://nbviewer.jupyter.org/url/norvig.com/ipython/Economics.ipynb>`_
<https://nbviewer.org/url/norvig.com/ipython/Economics.ipynb>`_
AlexWaygood marked this conversation as resolved.
Show resolved Hide resolved
a simulation of a marketplace by
`Peter Norvig <https://norvig.com/bio.html>`_ that shows effective
use of many of the tools and distributions provided by this module
(gauss, uniform, sample, betavariate, choice, triangular, and randrange).

`A Concrete Introduction to Probability (using Python)
<https://nbviewer.jupyter.org/url/norvig.com/ipython/Probability.ipynb>`_
<https://nbviewer.org/url/norvig.com/ipython/Probability.ipynb>`_
a tutorial by `Peter Norvig <https://norvig.com/bio.html>`_ covering
the basics of probability theory, how to write simulations, and
how to perform data analysis using Python.
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
Loading