Tilman Krummeck added the comment:
Hmm, ok, that sounds obvious. Thanks for the clarification.
--
___
Python tracker
<https://bugs.python.org/issue46
Tilman Krummeck added the comment:
Well, it's not bizarre, it's a use-case I'm facing quite often.
But thanks for the clarification, I haven't had very large populations in mind
- this makes indeed sense.
--
___
Py
Tilman Krummeck added the comment:
My suggestion is not to set k=1 when omitted but to assign it a random value
that is something between 0 and the maximum possible value which is:
sum(counts) if counts else len(population)
--
___
Python tracker
Tilman Krummeck added the comment:
I use this mostly in tests to randomize my inputs. So currently I'm doing
something like this:
result = random.sample(items, random.randint(0, len(items)))
I guess if someone would omit 'k' he wouldn't care about the result (which is
New submission from Tilman Krummeck :
random.sample can be used to choose k items from a given sequence. Currently, k
is a mandatory parameter.
I suggest to make k optional and instead, if omitted, pick a random value from
the range of 0 and the length of the sequence.
Of course, doing
Tilman Krummeck added the comment:
I've submitted the PR just now: https://github.com/python/cpython/pull/10032.
The CLA is signed but most probably not processed yet.
--
___
Python tracker
<https://bugs.python.org/is
Change by Tilman Krummeck :
--
keywords: +patch
pull_requests: +9370
stage: -> patch review
___
Python tracker
<https://bugs.python.org/issue35027>
___
___
Py
Tilman Krummeck added the comment:
I guess it's now or never. Give me some time to check the developer's guide and
I'll submit a doc fix for this.
--
___
Python tracker
<https://bugs.pyt
New submission from Tilman Krummeck :
The python documentation states at this point:
"Changed in version 3.7: setup now raises a TypeError if classifiers, keywords
and platforms fields are not specified as a list."
https://docs.python.org/3.7/distutils/setupscript.html#additional
New submission from Tilman Krummeck :
I found a problem by accident on Python 3.5.3 with the uuid library.
Running this:
from uuid import UUID
UUID(["string"])
This throws an AttributeError:
Traceback (most recent call last):
File "", line 1, in
File "C:\Users
10 matches
Mail list logo