Recent Posts

Python Tutorial / Process Data Lazily with Iterators and Generators
Distinguish iterable objects, iterators and generators, inspect partial consumption and evaluate lazy calculation, memory use and resource lifetime accurately.

Python Tutorial / Create Data-Centered Classes with dataclass
Use dataclass fields and default factories, validate initial data and distinguish generated equality, frozen fields and serialization from application policy.

Python Tutorial / Reuse Code with Inheritance and Composition
Compare inheritance with composition, preserve behavioral contracts and build a ledger that delegates to a replaceable fee policy.

Python Tutorial / Control Object Updates with Methods and Properties
Use property setters to validate initial and later assignments, preserve state after rejection and avoid recursive setters and hidden expensive operations.

Python Tutorial / Distinguish Instance Attributes from Class Attributes
Locate instance and class state, observe attribute shadowing and reproduce then fix a mutable list accidentally shared across instances.

Python Tutorial / Group State and Behavior with Classes and Instances
Define a focused class, create independent instances and understand self, initialization and the limits of validation performed only at construction.

Python Tutorial / Read Tracebacks and Diagnose Problems with Debugging and Logging
Read Python tracebacks, inspect state with a debugger and use logging levels and channels to diagnose reproducible failures without leaking sensitive details.

Python Tutorial / Handle Exceptions with try, except, else, finally and raise
Trace exception-handling paths, raise explicit validation errors and distinguish recoverable input failures from defects that should remain visible.

Python Tutorial / Convert and Save JSON Data
Map JSON values to Python, save readable Unicode and distinguish valid JSON syntax from valid application data and strict numeric policies.

Python Tutorial / Read and Write CSV Files
Use csv.DictReader and DictWriter with quoting and newline handling, convert numeric values and define header, error-reporting and spreadsheet-export policies.