ended4월 12일· 1 sources

The Real Cost of Python's Default Arguments

Python 기본값의 숨겨진 위험, 프로덕션 버그의 근원

Why it matters

Python's pass-by-reference myth leads developers to ship production bugs involving mutable default arguments. When functions use mutable objects as defaults, all callers share the same object in memory, causing mysterious data corruption across user sessions and background jobs. Understanding Python's actual memory model—where variables are references, not containers—is essential for preventing these insidious ghost bugs.

1
Sources
+0
24h
Growth
150d
Active
PythonMutable defaultsMemory modelObject mutationProduction bugs

Sources

Related Issues