Skip to content

Commit

Permalink
Fix bug when running with py38
Browse files Browse the repository at this point in the history
  • Loading branch information
spapanik committed May 3, 2024
1 parent ddfa465 commit d681b18
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/mathlib/primes.py
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ def factorise(n: int, known_primes: Iterable[int] = ()) -> dict[int, int]:

if n != 1:
missing_factors = factorise(n)
for factor in factors | missing_factors:
for factor in factors.keys() | missing_factors.keys():
factors[factor] = factors.get(factor, 0) + missing_factors.get(factor, 0)

return factors

0 comments on commit d681b18

Please sign in to comment.