[Python-checkins] [3.12] Add more examples to the recipe docs (GH-106782) (GH-106783)

rhettinger webhook-mailer at python.org
Sat Jul 15 16:09:24 EDT 2023


https://github.com/python/cpython/commit/18d98bacb62e4beb06e56deb18e7605bff499168
commit: 18d98bacb62e4beb06e56deb18e7605bff499168
branch: 3.12
author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com>
committer: rhettinger <rhettinger at users.noreply.github.com>
date: 2023-07-15T15:09:20-05:00
summary:

[3.12] Add more examples to the recipe docs (GH-106782) (GH-106783)

files:
M Doc/library/itertools.rst

diff --git a/Doc/library/itertools.rst b/Doc/library/itertools.rst
index a2d1798a2c6da..f88525456ff93 100644
--- a/Doc/library/itertools.rst
+++ b/Doc/library/itertools.rst
@@ -1045,6 +1045,8 @@ The following recipes have a more mathematical flavor:
    def factor(n):
        "Prime factors of n."
        # factor(99) --> 3 3 11
+       # factor(1_000_000_000_000_007) --> 47 59 360620266859
+       # factor(1_000_000_000_000_403) --> 1000000000000403
        for prime in sieve(math.isqrt(n) + 1):
            while True:
                quotient, remainder = divmod(n, prime)



More information about the Python-checkins mailing list