← Back to Python

Mutable Default Arguments

Pythonpython

The Question

Why are mutable default arguments dangerous in Python?

What a Strong Answer Covers

  • created once at definition
  • "shared across calls
  • "None default fix

Related Questions

  • GIL — What It Is and What It Protects
  • ThreadPoolExecutor & ProcessPoolExecutor
  • Decorators — Under the Hood
  • Generators & yield
  • Context Managers

Practice This Question

Get AI-graded feedback on your answer with follow-up probes on weak points.

Take the Free Assessment
GrindQuestionsAITechnical interview assessment
TermsPrivacyAbout