Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Games
Kajongg
Commits
a4402de0
Commit
a4402de0
authored
Apr 07, 2021
by
Wolfgang Rohdewald
Browse files
pylint: Random functions have new arg lists
parent
ef0fbff5
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/rand.py
View file @
a4402de0
...
...
@@ -62,7 +62,7 @@ class CountingRandom(Random):
if
Debug
.
random
:
self
.
game
.
debug
(
'Random gets seed %s'
%
a
)
def
randrange
(
self
,
start
,
stop
=
None
,
step
=
1
,
_int
=
int
):
def
randrange
(
self
,
start
,
stop
=
None
,
step
=
1
):
with
CountRandomCalls
(
self
,
'randrange({},{},step={})'
.
format
(
start
,
stop
,
step
)):
return
Random
.
randrange
(
self
,
start
,
stop
,
step
)
...
...
@@ -74,10 +74,10 @@ class CountingRandom(Random):
with
CountRandomCalls
(
self
,
'choice({})'
.
format
(
seq
)):
return
Random
.
choice
(
self
,
seq
)
def
sample
(
self
,
population
,
k
):
def
sample
(
self
,
population
,
k
,
*
,
counts
=
None
):
"""add debug output to sample. Chooses k unique random elements"""
with
CountRandomCalls
(
self
,
'sample({}, {})'
.
format
(
population
,
k
)):
return
Random
.
sample
(
self
,
population
,
k
)
return
Random
.
sample
(
self
,
population
,
k
,
counts
=
counts
)
def
shuffle
(
self
,
x
,
random
=
None
):
"""add debug output to shuffle. Shuffles list x in place."""
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment