Kaydet (Commit) f2eb2b44 authored tarafından Benjamin Peterson's avatar Benjamin Peterson

getrandombits is actually getrandbits

üst abe0aee3
...@@ -36,11 +36,11 @@ it likely that the generated sequences seen by each thread don't overlap. ...@@ -36,11 +36,11 @@ it likely that the generated sequences seen by each thread don't overlap.
Class :class:`Random` can also be subclassed if you want to use a different 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`, basic generator of your own devising: in that case, override the :meth:`random`,
:meth:`seed`, :meth:`getstate`, :meth:`setstate` and :meth:`jumpahead` methods. :meth:`seed`, :meth:`getstate`, :meth:`setstate` and :meth:`jumpahead` methods.
Optionally, a new generator can supply a :meth:`getrandombits` method --- this Optionally, a new generator can supply a :meth:`getrandbits` method --- this
allows :meth:`randrange` to produce selections over an arbitrarily large range. allows :meth:`randrange` to produce selections over an arbitrarily large range.
.. versionadded:: 2.4 .. versionadded:: 2.4
the :meth:`getrandombits` method. the :meth:`getrandbits` method.
As an example of subclassing, the :mod:`random` module provides the As an example of subclassing, the :mod:`random` module provides the
:class:`WichmannHill` class that implements an alternative generator in pure :class:`WichmannHill` class that implements an alternative generator in pure
......
...@@ -80,8 +80,8 @@ class Random(_random.Random): ...@@ -80,8 +80,8 @@ class Random(_random.Random):
Class Random can also be subclassed if you want to use a different basic Class Random can also be subclassed if you want to use a different basic
generator of your own devising: in that case, override the following generator of your own devising: in that case, override the following
methods: random(), seed(), getstate(), setstate() and jumpahead(). methods: random(), seed(), getstate(), setstate() and jumpahead().
Optionally, implement a getrandombits() method so that randrange() Optionally, implement a getrandbits() method so that randrange() can cover
can cover arbitrarily large ranges. arbitrarily large ranges.
""" """
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment