Tagged articles
2 articles
Page 1 of 1
Python Programming Learning Circle
Python Programming Learning Circle
Feb 8, 2020 · Fundamentals

Common Python Pitfalls and How to Avoid Them

This article surveys typical Python traps—including UnboundLocalError, mutable default arguments, in‑place versus out‑of‑place updates, tuple syntax, shared mutable containers, list mutation during iteration, closure late binding, __del__ pitfalls, import inconsistencies, version differences, operator quirks, attribute magic methods, and the GIL—explaining why they occur and offering safe alternatives.

GILImportPitfalls
0 likes · 12 min read
Common Python Pitfalls and How to Avoid Them
MaGe Linux Operations
MaGe Linux Operations
Jun 4, 2019 · Fundamentals

10 Common Python Pitfalls Every Developer Should Avoid

This article explains ten subtle Python pitfalls—including UnboundLocalError, mutable default arguments, the difference between x += y and x = x + y, tuple syntax, list‑of‑lists initialization, modifying a list while iterating, closure‑late binding with lambdas, __del__ interactions with garbage collection, inconsistent module imports, Python‑2‑to‑3 migration quirks, and the Global Interpreter Lock—providing clear examples and recommended fixes.

Pitfallsclosuresmutable-default-args
0 likes · 12 min read
10 Common Python Pitfalls Every Developer Should Avoid