awesome-repositories.com
博客
MCP
awesome-repositories.com

通过 AI 驱动的搜索,发现最优秀的开源仓库。

探索精选搜索开源替代品自托管软件博客网站地图
项目MCP 服务器关于排名机制媒体报道
法律隐私政策服务条款
© 2026 Bringes Technology SRL·VAT RO45896025·hello@awesome-repositories.com
·

3 个仓库

Awesome GitHub RepositoriesMutable Default Argument Guards

Patterns that prevent hidden shared state by using None as a sentinel and reassigning the mutable value inside the function body.

Distinct from Default Arguments: Distinct from Default Arguments: focuses specifically on the Python anti-pattern of mutable default arguments and the guard pattern to avoid it.

Explore 3 awesome GitHub repositories matching programming languages & runtimes · Mutable Default Argument Guards. Refine with filters or upvote what's useful.

Awesome Mutable Default Argument Guards GitHub Repositories

用 AI 发现最棒的仓库。我们将通过 AI 为您搜索最匹配的仓库。
  • chalarangelo/30-seconds-of-pythonChalarangelo 的头像

    Chalarangelo/30-seconds-of-python

    8,826在 GitHub 上查看↗

    30 Seconds of Python is a curated collection of short, reusable Python code snippets designed for quick reference and immediate reuse. It provides an interactive browser that lets you explore snippets organized by tags, search across names and descriptions, and copy code to your clipboard with a single click. The collection covers a broad range of common programming tasks, including list and dictionary operations, string formatting and manipulation, date and time calculations, and color format conversion. It also includes utilities for data transformation, such as converting between case styl

    Provides a code snippet demonstrating how to avoid mutable default arguments in Python functions.

    Pythoneducationlearn-to-codelearning-resources
    在 GitHub 上查看↗8,826
  • jackzhenguo/python-small-examplesjackzhenguo 的头像

    jackzhenguo/python-small-examples

    8,132在 GitHub 上查看↗

    This project is a comprehensive library of practical Python code examples and patterns. It provides a collection of scripts and snippets designed to demonstrate a wide range of programming tasks, from basic syntax to advanced implementation patterns. The repository focuses on several core domains, including the implementation of concurrency and multithreading examples, data analysis snippets for cleaning and manipulating tabular data, and various data visualization examples. It also covers automation scripts for file system management and a variety of general programming patterns. Additional

    Implements guards against the mutable default argument anti-pattern by using None as a sentinel.

    Pythondata-sciencemachine-learningpython
    在 GitHub 上查看↗8,132
  • python-attrs/attrspython-attrs 的头像

    python-attrs/attrs

    5,799在 GitHub 上查看↗

    attrs is a Python library that automatically generates initialization, representation, equality, hashing, and ordering methods from declarative class attribute definitions. At its core, it provides a class decorator metaprogramming framework that intercepts class creation to rewrite the class body, producing dunder methods without manual boilerplate. The library includes a comprehensive attribute validation toolkit with built-in validators for type checks, range constraints, regex matching, length limits, and logical composition of validation rules. The library distinguishes itself through it

    Provides per-instance mutable default values via factory functions, avoiding shared-state bugs in data classes.

    Python
    在 GitHub 上查看↗5,799
  1. Home
  2. Programming Languages & Runtimes
  3. Function Argument Passing
  4. Default Arguments
  5. Mutable Default Argument Guards

探索子标签

  • Per-Instance Mutable DefaultsMechanisms that create fresh copies of mutable default values for each instance to prevent shared-state bugs. **Distinct from Mutable Default Argument Guards:** Distinct from Mutable Default Argument Guards: focuses on class attribute defaults with per-instance copying, not function argument guard patterns.