Hacker News new | ask | show | jobs
by stevesycombacct 2108 days ago
One bit of feedback on "3. Mutating values"

The reason that

    _ = [validations.pop(key) for key in ('executed','filter_type')]
     
is a mutation is because of the .pop() command, which the article didn't state. .pop() removes items in-place, thus mutating the data. Since the function doesn't make a copy of the dictionary, the original variable gets mutated.

This may confuse those wondering what the difference between the two functions is.

Otherwise, I find the article's points reasonable.