Skip to main content
PyCon US is happening May 14th-22nd in Pittsburgh, PA USA.  Learn more

Python 3 compatible Python 2 `random` Module.

Project description

CHANGES

1.0.2 (2023-12-18)

  • Change support to Python 3.10, 3.11, 3.12, and 3.13 only.

1.0.1 (2013-03-15)

  • Fix setup.py so that an install of the package will actually work.

1.0.0 (2013-03-06)

  • Initial PyPI release.

Random 2

https://github.com/strichter/random2/actions/workflows/test.yml/badge.svg https://img.shields.io/pypi/v/random2.svg https://img.shields.io/pypi/pyversions/random2.svg

This package provides a Python 3 ported version of Python 2.7’s random module. It has also been back-ported to work in Python 2.6.

In Python 3, the implementation of randrange() was changed, so that even with the same seed you get different sequences in Python 2 and 3. Note that several high-level functions such as randint() and choice() use randrange().

In my testing code I heavily rely on stable random generator results and it makes porting code to Python 3 a lot harder, if all those tests have to be adjusted. This package fixes that.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page