Tagged articles
16 articles
Page 1 of 1
IT Services Circle
IT Services Circle
Oct 7, 2025 · Fundamentals

Unlock Python Dictionaries with __missing__: Transform Missing Keys into Smart Logic

This article explores Python's __missing__ dunder method, showing how it surpasses traditional approaches like if/else, .get() and defaultdict by enabling dynamic, self‑healing dictionary behavior, and demonstrates advanced real‑world applications such as smart counters, infinite nested dicts, API caching, and automatic data pipelines.

API cachePython__missing__
0 likes · 13 min read
Unlock Python Dictionaries with __missing__: Transform Missing Keys into Smart Logic
Code Mala Tang
Code Mala Tang
Apr 29, 2025 · Fundamentals

Unlock Python’s Hidden Power: Mastering the __dict__ Attribute

Explore how Python’s built-in __dict__ attribute stores object attributes, enabling introspection, dynamic attribute manipulation, memoization, JSON serialization, custom descriptors, and debugging, while also learning its limitations with slots and built-in types for performance.

AttributesIntrospectionPython
0 likes · 8 min read
Unlock Python’s Hidden Power: Mastering the __dict__ Attribute
Satori Komeiji's Programming Classroom
Satori Komeiji's Programming Classroom
Aug 29, 2024 · Fundamentals

How Python Dictionaries Resize: The Full Expansion Process

The article explains Python's dict resizing mechanism, detailing when the hash table grows (when used entries reach two‑thirds of capacity), how the new size is chosen as the smallest power‑of‑two ≥ ma_used × 3, and the exact steps the interpreter takes to reallocate and rebuild the underlying key and entry arrays.

Memory ManagementPythoncombined-table
0 likes · 12 min read
How Python Dictionaries Resize: The Full Expansion Process
Python Programming Learning Circle
Python Programming Learning Circle
Jul 21, 2021 · Fundamentals

Understanding Python's __dict__ System, Properties, and Dynamic Attribute Generation

This article explains Python's __dict__ attribute storage, class and instance attributes, demonstrates how to inspect and modify them, introduces properties using the built‑in property() function, and shows dynamic attribute generation with __getattr__, providing clear code examples and explanations.

AttributesObject-OrientedProperty
0 likes · 9 min read
Understanding Python's __dict__ System, Properties, and Dynamic Attribute Generation
Python Crawling & Data Mining
Python Crawling & Data Mining
Feb 20, 2021 · Fundamentals

Unlock Python’s Speed: Master dict and set for Fast Data Lookup

This article explains Python’s built-in dict and set structures, comparing them with lists, demonstrating their fast key-value lookups, handling missing keys, and common operations like insertion, deletion, and set algebra, while providing clear code examples and practical tips for effective use.

Data StructuresImmutable ObjectsPython
0 likes · 9 min read
Unlock Python’s Speed: Master dict and set for Fast Data Lookup
Test Development Learning Exchange
Test Development Learning Exchange
Jul 15, 2018 · Fundamentals

Using Python dict() to Create and Manipulate Dictionaries

This article explains how the Python dict() function creates new dictionaries, demonstrates various ways to supply key/value pairs—including empty dictionaries, literal mappings, keyword arguments, lists of tuples, and zip()—and provides examples of common dictionary methods such as clear, copy, fromkeys, get, items, keys, pop, popitem, setdefault, and update.

Pythondictdictionary
0 likes · 5 min read
Using Python dict() to Create and Manipulate Dictionaries
MaGe Linux Operations
MaGe Linux Operations
Jul 2, 2018 · Fundamentals

Why Python Behaves Unexpectedly: 10 Surprising Code Quirks Explained

This article explores ten puzzling Python behaviors—from implicit dictionary key conversion and generator timing quirks to list‑iteration deletions, else clause nuances, the difference between is and ==, loop variable leakage, + versus +=, try‑finally returns, mutable True/False assignments, and subtle for‑loop mechanics—providing clear explanations and code examples for each.

/loopPythondict
0 likes · 11 min read
Why Python Behaves Unexpectedly: 10 Surprising Code Quirks Explained
MaGe Linux Operations
MaGe Linux Operations
Jun 8, 2017 · Fundamentals

How Python’s dict Uses Hash Tables and Open Addressing Explained

This article explains how Python implements dictionaries with hash tables, details the hash function for strings, demonstrates collision handling via open addressing and quadratic probing, and walks through the underlying C structures, initialization, insertion, resizing, and deletion processes.

Pythonc-implementationdict
0 likes · 8 min read
How Python’s dict Uses Hash Tables and Open Addressing Explained