Skip to content

Commit 43b8db3

Browse files
authored
Update linear_congruential_generator.py
1 parent ba687e9 commit 43b8db3

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

other/linear_congruential_generator.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,18 @@ class LinearCongruentialGenerator:
88
A pseudorandom number generator.
99
"""
1010

11+
# The default value for **seed** is the result of a function call which is not
12+
# normally recommended and causes flake8-bugbear to raise a B008 error. However,
13+
# in this case, it is accptable because `LinearCongruentialGenerator.__init__()`
14+
# will only be called once per instance and it ensures that each instance will
15+
# generate a unique sequence of numbers.
16+
1117
def __init__(self, multiplier, increment, modulo, seed=int(time())): # noqa: B008
1218
"""
1319
These parameters are saved and used when nextNumber() is called.
1420
1521
modulo is the largest number that can be generated (exclusive). The most
1622
efficient values are powers of 2. 2^32 is a common value.
17-
18-
The default value for **seed** is the result of a function call which is not
19-
normally recommended and causes flake8-bugbear to raise a B008 error. However,
20-
in this case, it is accptable because `LinearCongruentialGenerator.__init__()`
21-
will only be called once per instance and it ensures that each instance will
22-
generate a unique sequence of numbers.
2323
"""
2424
self.multiplier = multiplier
2525
self.increment = increment

0 commit comments

Comments
 (0)