On 28/08/2017 20:17, Leam Hall wrote:
> On 08/28/2017 11:40 AM, Dennis Lee Bieber wrote:
>
> ... a bunch of good stuff ...
>
> I'm (re-)learning python and just trying make sure my function works.
> Not at the statistical or cryptographic level. :)
>
> Thanks!
>
> Leam
If it's supposed to
On Wed, Aug 30, 2017 at 1:39 AM, Stefan Ram wrote:
> Dennis Lee Bieber writes:
>>Testing randomness itself requires statistical tests...
>
> A perfectly random coin /can/ yield "heads" a thousand times
> in sequence (which is very unlikely, but
On 8/28/17, Leam Hall wrote:
> On 08/28/2017 11:40 AM, Dennis Lee Bieber wrote:
>
> ... a bunch of good stuff ...
>
> I'm (re-)learning python and just trying make sure my function works.
> Not at the statistical or cryptographic level. :)
>
> Thanks!
>
> Leam
> --
>
Steven D'Aprano wrote:
> Wait... are you saying that importing test_mymodule monkey-patches the
> current library? And doesn't un-patch it afterwards? That's horrible.
There's something in the library, unittest.mock that makes this relatively
safe -- if not painless
with
On Tue, Aug 29, 2017 at 5:39 PM, Steven D'Aprano
wrote:
> On Tue, 29 Aug 2017 12:25:45 +1000, Chris Angelico wrote:
>
>> For a lot of functions, this completely destroys the value of
>> doctesting.
>
>
> "The" value? Doc tests have two values: documentation
On Tue, 29 Aug 2017 12:25:45 +1000, Chris Angelico wrote:
> On Tue, Aug 29, 2017 at 11:53 AM, Steve D'Aprano
> wrote:
>> (1) Disable doctesting for that example, and treat it as just
>> documentation:
>>
>> def my_thing():
>> """blah blah blah
>>
>> >>>
On Tue, Aug 29, 2017 at 11:53 AM, Steve D'Aprano
wrote:
> (1) Disable doctesting for that example, and treat it as just documentation:
>
> def my_thing():
> """blah blah blah
>
> >>> my_thing() #doctest:+SKIP
> 4
>
> """
For a lot of functions, this
On Mon, 28 Aug 2017 07:41 pm, Leam Hall wrote:
> Is this a good way to test if random numeric output? It seems to work
> under Python 2.6 and 3.6 but that doesn't make it 'good'.
That depends on what you are actually testing. If you are intending to test the
statistical properties of random,
On 08/28/2017 11:40 AM, Dennis Lee Bieber wrote:
... a bunch of good stuff ...
I'm (re-)learning python and just trying make sure my function works.
Not at the statistical or cryptographic level. :)
Thanks!
Leam
--
https://mail.python.org/mailman/listinfo/python-list
Leam Hall wrote:
> Is this a good way to test if random numeric output? It seems to work
> under Python 2.6 and 3.6 but that doesn't make it 'good'.
>
> ### Code
> import random
>
> def my_thing():
>""" Return a random number from 1-6
>>>> 0 < my_thing() <=6
>True
>>>> 6 <
Is this a good way to test if random numeric output? It seems to work
under Python 2.6 and 3.6 but that doesn't make it 'good'.
### Code
import random
def my_thing():
""" Return a random number from 1-6
>>> 0 < my_thing() <=6
True
>>> 6 < my_thing()
False
"""
return
11 matches
Mail list logo