Browse by Topic
Popular
Popular Posts
Latest
Latest Python Posts
Python Mutable vs Hashable: What Every Developer Should Know
Understand why mutable built-in types are not hashable in Python, how hashability affects dict keys and set membership, and when to override __hash__ and __eq__ in custom classes.
Python Hashable Types: Dict Keys and Set Members
Learn what makes a Python type hashable, why dictionary keys and set members require it, and how to implement __hash__ and __eq__ correctly.
Understanding Python Immutable Data Types
python immutable data types: Learn how Python's immutable data types behave, why they matter for memory and concurrency, and how to build custom immutable objects.
Python Mutable Data Types: Behavior and Pitfalls
Learn how Python's mutable data types behave, why assignments and function calls can cause surprising side effects, and how to copy lists, dictionaries, and sets correctly.
Python Mutable vs Immutable Types: Behavior and Tradeoffs
Explains how Python's mutable and immutable types differ in assignment, aliasing, hashing, and memory behavior, with practical code examples and guidance for choosing the right type.
Python type vs isinstance: When to Use Each
Understand the practical difference between Python's type() and isinstance(), including inheritance behavior, protocol checks, and when to use each.
Using isinstance in Python for Runtime Type Checks
python isinstance: Learn how isinstance works in Python, when to use it over type(), how inheritance affects results, and where runtime type checks are appropriate.
Python type() Function: Runtime Type Inspection and Dynamic Classes
Learn how Python's type() function inspects object types and creates classes dynamically, and when to prefer isinstance() for robust type checking.
Python None Type: Behavior, Pitfalls, and Best Practices
Understand Python's None type: singleton behavior, is None comparisons, Optional type hints, and common pitfalls like mutable default arguments.
Python Dict Type: Syntax, Typing, and Performance
Learn how the Python dict type works at runtime, how to annotate dicts with type hints, and when to choose another data structure.