From: Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> Date: Sat, 15 Jul 2023 20:09:20 +0000 (-0700) Subject: [3.12] Add more examples to the recipe docs (GH-106782) (GH-106783) X-Git-Tag: v3.12.0rc1~149 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=18d98bacb62e4beb06e56deb18e7605bff499168;p=thirdparty%2FPython%2Fcpython.git [3.12] Add more examples to the recipe docs (GH-106782) (GH-106783) --- diff --git a/Doc/library/itertools.rst b/Doc/library/itertools.rst index a2d1798a2c6d..f88525456ff9 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)