]> granicus.if.org Git - python/commitdiff
Doc: Fix is_prime (GH-9909)
authorJulien Palard <julien@palard.fr>
Wed, 17 Oct 2018 06:45:51 +0000 (08:45 +0200)
committerGitHub <noreply@github.com>
Wed, 17 Oct 2018 06:45:51 +0000 (08:45 +0200)
Doc/library/concurrent.futures.rst

index 47ca6b38f84eeea7e1fe417c8aeef88c9769e917..3890e49f597b770fff4915a38cb39493e8a40df4 100644 (file)
@@ -257,6 +257,10 @@ ProcessPoolExecutor Example
        1099726899285419]
 
    def is_prime(n):
+       if n < 2:
+           return False
+       if n == 2:
+           return True
        if n % 2 == 0:
            return False