On 2 February 2017 at 12:01, <himchante...@gmail.com> wrote:

> P.P.S.: The function is tested, itโ€™s working ๐Ÿ˜Š
>

First of all, thanks for your suggestion, and for taking the time to help
improve Python. As noted, random.uniform probably does what you want, so we
don't really need this function.

But in case it's of interest to you, there's some additional considerations
around proposed additions to the stdlib that we'd normally look at with a
suggestion like this. If you find any other improvements you'd be
interested in proposing, it might be helpful to you to be aware of them.

The first thing that struck me was the performance of your approach. With
multiple number<->string conversions it is likely to be extremely slow,
making this function completely unsuitable for things like simulations,
where the ability to generate many millions of results fast is critical.
Python stdlib functions typically get used in a wide range of situations,
and we need to make sure they are suitable for as large a range of
applications as we can.

Also, I'd be curious to know how you tested your function. Random number
generators are notoriously difficult to get right, and you are here
combining the results of multiple calls to the underlying PRNG. By doing
so, you might (as far as I know, it's unlikely, but it's possible) have
degraded the randomness of the result. Did your function pass the standard
tests for randomness? Note: I don't know what those tests are, but I do
know that such things exist, and I'd expect anything in the stdlib to have
been validated by people who *do* know such things. Again, stdlib functions
get used in a wide range of applications, and the authors typically rely on
the Python developers to have "got the details right" on their behalf.

Anyway, these are just a couple of thoughts for you. I hope they were of
interest, and thanks again for contributing.

Paul
_______________________________________________
Python-ideas mailing list
Python-ideas@python.org
https://mail.python.org/mailman/listinfo/python-ideas
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to