diff options
Diffstat (limited to 'Doc/library/doctest.rst')
-rw-r--r-- | Doc/library/doctest.rst | 16 |
1 files changed, 2 insertions, 14 deletions
diff --git a/Doc/library/doctest.rst b/Doc/library/doctest.rst index df1f6e3..721d7c0 100644 --- a/Doc/library/doctest.rst +++ b/Doc/library/doctest.rst @@ -38,17 +38,10 @@ Here's a complete but small example module:: def factorial(n): """Return the factorial of n, an exact integer >= 0. - If the result is small enough to fit in an int, return an int. - Else return a long. - >>> [factorial(n) for n in range(6)] [1, 1, 2, 6, 24, 120] - >>> [factorial(long(n)) for n in range(6)] - [1, 1, 2, 6, 24, 120] >>> factorial(30) - 265252859812191058636308480000000L - >>> factorial(30L) - 265252859812191058636308480000000L + 265252859812191058636308480000000 >>> factorial(-1) Traceback (most recent call last): ... @@ -60,7 +53,7 @@ Here's a complete but small example module:: ... ValueError: n must be exact integer >>> factorial(30.0) - 265252859812191058636308480000000L + 265252859812191058636308480000000 It must also not be ridiculously large: >>> factorial(1e100) @@ -109,11 +102,6 @@ it's trying, and prints a summary at the end:: Expecting: [1, 1, 2, 6, 24, 120] ok - Trying: - [factorial(long(n)) for n in range(6)] - Expecting: - [1, 1, 2, 6, 24, 120] - ok And so on, eventually ending with:: |