Robert Kern <[EMAIL PROTECTED]> writes:
> Steven D'Aprano wrote:
> > Does anyone have generic advice for the testing and development of
> > this sort of function?
>
> "Design for Testability". In library code, never call the functions
> in the random module. Always take as an argument a random.Ran
Steven D'Aprano wrote:
> I'm working on some functions that, essentially, return randomly generated
> strings. Here's a basic example:
>
> def rstr():
> """Return a random string based on a pseudo
> normally-distributed random number.
> """
> x = 0.0
> for i in range(12):
>
I'm working on some functions that, essentially, return randomly generated
strings. Here's a basic example:
def rstr():
"""Return a random string based on a pseudo
normally-distributed random number.
"""
x = 0.0
for i in range(12):
x += random.random()
return str(i