3 ms·
IMO those two gotchas (mutable default and late-binding closures) are actually the main ones. That's why they're mentioned explicitly here https://docs.python-g
by neolog 6y ago
IMO those two gotchas (mutable default and late-binding closures) are actually the main ones. That's why they're mentioned explicitly here https://docs.python-guide.org/writing/gotchas/ https://docs.python-guide.org/writing/gotchas/
Shallow/deep copies is an unavoidable part of having mutable data. The main alternative way to handle mutation is a fancy type system like Rust's, which is not an acceptable tradeoff for new programmers.