Python Forum

Full Version: when would a frozenset be needed?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
I see, however this well may be an error in the example code, given the comment
Quote: # at this point, *numbers* still has 1_000_000 key/values, and
# *numbers_without_997_multiples* is a copy of *numbers* without
# values that are multiples of 997.

i.e. copy definitely has changed
so the author did not intend to del twice, didn't realize that 591221 would do that, and should have used just 500000 numbers in his example (or a pair of larger primes)?
I cannot be sure, but yes, it really looks like this.
Pages: 1 2