[issue40046] Increase test coverage of the random module

2020-03-30 Thread Carol Willing


Carol Willing  added the comment:

Thanks Serhiy for the explanation.

I agree with Raymond about the doc change.

Raymond, These tests, after reading Serihy's response, make sense to me. Let's 
revisit and reconsider the PR on the tests without the doc change.

Thanks!

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue40046] Increase test coverage of the random module

2020-03-30 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Yes, of course. The PR adds new tests for different types of arguments which 
currently are accepted (so it would be a regression if they will no accepted in 
new releases or in alternate implementations) and for types which currently are 
not accepted for reasons, so unexpected accepting may signal about using 
inefficient or incorrect algorithm.

For example, choice() works not only with lists, but with other sequences, so 
the implementation which works only with lists (for example the C 
implementation which uses the concrete C API) will fail with new tests. If we 
fix this hypothetical implementation by converting the argument to list (which 
would be inefficient for large collections), other new tests (which check that 
sets and iterators are not accepted) will fail.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue40046] Increase test coverage of the random module

2020-03-30 Thread Carol Willing


Carol Willing  added the comment:

Hi Raymond and Serhiy,

Serhiy, Was there a specific use case or regression that you felt the tests 
would be helpful?

--
nosy: +willingc

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue40046] Increase test coverage of the random module

2020-03-23 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

What is wrong with adding more tests?

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue40046] Increase test coverage of the random module

2020-03-23 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

I'm against this doc change.  While factually true, it is irrelevant and 
distracting to most users.  We do not need to test and document every 
implementation detail, nor should we.

--
resolution:  -> rejected
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue40046] Increase test coverage of the random module

2020-03-23 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
keywords: +patch
pull_requests: +18475
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/19114

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue40046] Increase test coverage of the random module

2020-03-23 Thread Serhiy Storchaka


New submission from Serhiy Storchaka :

The propose test adds several tests for random module. Mainly tests for 
integer, sequence and iterable arguments.

It also documents that randrange() accepts non-integers.

--
assignee: docs@python
components: Documentation, Tests
messages: 364840
nosy: docs@python, mark.dickinson, rhettinger, serhiy.storchaka, tim.peters
priority: normal
severity: normal
status: open
title: Increase test coverage of the random module
type: enhancement
versions: Python 3.7, Python 3.8, Python 3.9

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com