logo

Python Pitfalls: The Perils of Using Lists and Dicts as Default Arguments

ID: b7744fb2-21a9-5d90-81f3-e03b2a7a400f

STIX ID: report--b7744fb2-21a9-5d90-81f3-e03b2a7a400f

Feed Name: HackerOne Blog

Date Published: 2023-12-20

Date Updated: 2026-06-12

...
...

This document explains the common Python pitfall of using mutable default arguments (like lists and dictionaries), demonstrates how repeated calls can share state, and recommends using `None` and initializing new instances inside the function to avoid unexpected behavior.

Your team is not currently subscribed to this feed. You must subscribe to it in order to see this post.