Skip to content

Docs: random.seed() uses the absolute value of its integer argument #142527

@jsalsman

Description

@jsalsman

Documentation

Currently the documentation for random.seed(a) says:

...

If a is an int, it is used directly.

With version 2 (the default), a str, bytes, or bytearay object gets converted to an int and all of its bits are used....

The first paragraph needs to clarify that if a is negative, its absolute value is used as the seed. The second paragraph should end with "all of its bits except the sign are used."

(This was recently mentioned by Andrej Karpathy on Twitter.)

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Labels

    docsDocumentation in the Doc dir

    Projects

    Status

    Todo

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions