Python tutorials
87 articles · page 4 of 5Hand-written tutorials, ordered as a recommended learning path.
- 61 Advanced Dataclasses Go beyond basic dataclass usage with post-init processing, field factories, inheritance, frozen instances, and custom serialization.
- 62 Descriptors & Properties Understand Python's descriptor protocol, how properties work internally, and how to build reusable validation descriptors.
- 63 itertools Recipes Master Python's itertools module with practical recipes for grouping, windowing, chaining, and processing iterables efficiently.
- 64 Memory & GC Explore how CPython manages memory with reference counting, generational garbage collection, and practical tips to avoid memory leaks.
- 65 Metaclasses Demystify Python metaclasses with practical examples. Learn how classes are created, when to use metaclasses, and real-world patterns.
- 66 pathlib Guide Replace os.path with pathlib for cleaner, more readable file path handling in Python. Covers all essential operations with examples.
- 67 __slots__ Optimization Learn how __slots__ reduces memory usage in Python classes, when to use it, and the trade-offs involved.
- 68 asyncio Learn Python's asyncio — coroutines, tasks, event loops, async generators, and building concurrent I/O-bound applications.
- 69 Dataclasses Master Python dataclasses — automatic __init__, __repr__, ordering, immutability, default factories, and post-init processing.
- 70 Advanced Decorators Go beyond basic decorators: decorator factories, class decorators, functools.wraps, stacking behavior, and real-world patterns used in production Python code.
- 71 Generators Deep Dive A thorough exploration of Python generators: yield mechanics, send and throw, generator pipelines, memory efficiency, coroutine basics, and practical patterns.
- 72 Django ORM How Django QuerySets lazily build SQL, how to avoid N+1 queries with select_related and prefetch_related, and patterns to keep the ORM fast under real load.
- 73 FastAPI DI How FastAPI's Depends system actually works, the lifecycle of dependencies, scoping with yield, and patterns for testable, layered FastAPI apps.
- 74 asyncio Loop Understand how Python's asyncio event loop schedules coroutines, what await actually does, and how to avoid the classic mistakes that turn async code into a tangle of bugs.
- 75 Decorators A practical tour of Python decorators: how they work under the hood, when to use them, and how to write decorators that preserve metadata, accept arguments, and stack cleanly.
- 76 Logging How to set up Python logging properly: loggers vs handlers, structured logs, contextual fields, log levels that scale, and how to avoid the classic print-debug trap.
- 77 MP vs Threads When to use threads, when to use processes, and why the GIL shapes both choices. A practical comparison with code, benchmarks, and patterns for real workloads.
- 78 Async & Await A gentle introduction to Python's async and await — coroutines, the event loop, awaiting tasks, asyncio.gather for concurrency, and when async actually helps.
- 79 Error Handling A practical guide to error handling in Python — catching specific exceptions, the else and finally clauses, raising and re-raising, custom exception types, and habits that lead to robust code.
- 80 f-Strings A complete guide to Python f-strings — basic interpolation, format specifiers for numbers and dates, alignment and padding, debug syntax, and when to choose other formatting methods.