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

Documentation for random module should indicate that a call to seed() is not required #52057

Closed
JustinLebar mannequin opened this issue Jan 30, 2010 · 4 comments
Closed
Assignees
Labels
docs Documentation in the Doc dir

Comments

@JustinLebar
Copy link
Mannequin

JustinLebar mannequin commented Jan 30, 2010

BPO 7809
Nosy @birkenfeld, @rhettinger, @ezio-melotti

Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

Show more details

GitHub fields:

assignee = 'https://github.com/rhettinger'
closed_at = <Date 2010-01-31.04:36:30.573>
created_at = <Date 2010-01-30.06:05:53.911>
labels = ['docs']
title = 'Documentation for random module should indicate that a call to seed() is not required'
updated_at = <Date 2010-01-31.04:36:30.571>
user = 'https://bugs.python.org/JustinLebar'

bugs.python.org fields:

activity = <Date 2010-01-31.04:36:30.571>
actor = 'rhettinger'
assignee = 'rhettinger'
closed = True
closed_date = <Date 2010-01-31.04:36:30.573>
closer = 'rhettinger'
components = ['Documentation']
creation = <Date 2010-01-30.06:05:53.911>
creator = 'Justin.Lebar'
dependencies = []
files = []
hgrepos = []
issue_num = 7809
keywords = []
message_count = 4.0
messages = ['98551', '98552', '98553', '98605']
nosy_count = 4.0
nosy_names = ['georg.brandl', 'rhettinger', 'ezio.melotti', 'Justin.Lebar']
pr_nums = []
priority = 'normal'
resolution = None
stage = None
status = 'closed'
superseder = None
type = None
url = 'https://bugs.python.org/issue7809'
versions = []

@JustinLebar
Copy link
Mannequin Author

JustinLebar mannequin commented Jan 30, 2010

Many programmers are used to languages where the RNG is deterministic unless it's explicitly seeded. This does not appear to be the case in Python.

The documentation for random should indicate that Random objects are seeded on construction, and that the global random object is seeded when the random package is first imported.

http://docs.python.org/3.1/library/random.html

@JustinLebar JustinLebar mannequin assigned birkenfeld Jan 30, 2010
@JustinLebar JustinLebar mannequin added the docs Documentation in the Doc dir label Jan 30, 2010
@ezio-melotti
Copy link
Member

It's already indicated in the documentation for random.seed([x]):
"If x is omitted or None, current system time is used; current system time is also used to initialize the generator when the module is first imported."

@JustinLebar
Copy link
Mannequin Author

JustinLebar mannequin commented Jan 30, 2010

Ack. I read it twice looking for that line!

Perhaps it should still indicate that new Random objects are automatically seeded. And perhaps the line I missed should be a little bit louder?

@rhettinger
Copy link
Contributor

ISTM, the docs are fine in this regard. The very long history of this module suggests that this is not a recurring point of confusion.

@rhettinger rhettinger assigned rhettinger and unassigned birkenfeld Jan 31, 2010
@ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Documentation in the Doc dir
Projects
None yet
Development

No branches or pull requests

3 participants