Python guides
Every published Python guide, newest first, with practical examples you can copy into your own project.
3,965 guides across 14 topics
Topics
Popular Python guides
Most readLatest Python guides
Page 175 of 179Understanding 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.
Python frozenset Type: Syntax, Hashability, and Use
Learn the Python frozenset type: creation syntax, hashability for dictionary keys, read-only set operations, memory behavior, and when to choose it over set or tuple.
Python Set Type: Syntax, Operations, and Performance
Learn how the Python set type works: creation syntax, set operators and methods, hash-based membership testing, performance tradeoffs, and common errors.