---
id: 2018
title: "Python Pitfalls: The Perils of Using Lists and Dicts as Default Arguments"
source_domain: hackerone.com
source_url: "https://www.hackerone.com/blog/python-pitfalls-perils-using-lists-and-dicts-default-arguments"
published_at: "2023-12-20T04:17:11Z"
tags: ["python", "best-practices", "programming", "mutable-defaults", "bugs"]
phying_url: "https://phying.com/item/2018"
lang: en
---

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

## Summary

Explains Python's mutable default argument pitfall, where lists and dicts defined in function signatures persist across calls, and shows how to avoid it.

## Intelligence Metadata

- **Sources:** hackerone.com
- **Published:** 2023-12-20T04:17:11Z
- **Original:** https://www.hackerone.com/blog/python-pitfalls-perils-using-lists-and-dicts-default-arguments
- **Phying News:** https://phying.com/item/2018
