[issue46190] Omit k in random.sample()

2021-12-29 Thread Tilman Krummeck
Tilman Krummeck added the comment: Hmm, ok, that sounds obvious. Thanks for the clarification. -- ___ Python tracker <https://bugs.python.org/issue46

[issue46190] Omit k in random.sample()

2021-12-28 Thread Tilman Krummeck
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

[issue46190] Omit k in random.sample()

2021-12-28 Thread Tilman Krummeck
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

[issue46190] Omit k in random.sample()

2021-12-28 Thread Tilman Krummeck
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

[issue46190] Omit k in random.sample()

2021-12-28 Thread Tilman Krummeck
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

[issue35027] distutils.core.setup does not raise TypeError when if classifiers, keywords and platforms fields are not specified as a list

2018-10-21 Thread Tilman Krummeck
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

[issue35027] distutils.core.setup does not raise TypeError when if classifiers, keywords and platforms fields are not specified as a list

2018-10-21 Thread Tilman Krummeck
Change by Tilman Krummeck : -- keywords: +patch pull_requests: +9370 stage: -> patch review ___ Python tracker <https://bugs.python.org/issue35027> ___ ___ Py

[issue35027] distutils.core.setup does not raise TypeError when if classifiers, keywords and platforms fields are not specified as a list

2018-10-19 Thread Tilman Krummeck
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

[issue35027] distutils.core.setup does not raise TypeError when if classifiers, keywords and platforms fields are not specified as a list

2018-10-19 Thread Tilman Krummeck
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

[issue31888] Creating a UUID with a list throws bad exception

2017-10-27 Thread Tilman Krummeck
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