Python

Modern Python Advanced #7 Performance — cProfile, py-spy, Memory Profiling
8 min read

Modern Python Advanced #7 Performance — cProfile, py-spy, Memory Profiling

A toolbox for finding and fixing slow Python code — timeit, cProfile, py-spy, line_profiler, memray, and common optimization patterns.

Modern Python Advanced #6: Advanced typing — Variance, ParamSpec, Self, overload
4 min read

Modern Python Advanced #6: Advanced typing — Variance, ParamSpec, Self, overload

Next step from intermediate typing — covariance/contravariance, ParamSpec and Concatenate, Self, TypeGuard/TypeIs, and @overload.

Modern Python Advanced #5: GIL and concurrency — threading vs multiprocessing vs asyncio
7 min read

Modern Python Advanced #5: GIL and concurrency — threading vs multiprocessing vs asyncio

What the GIL is, the role of threading/multiprocessing/asyncio, and the free-threaded build of Python 3.13–3.14 (PEP 703/779) — all in one place.

Modern Python Advanced #4: Async in depth — event loop, gather/wait, async generator
4 min read

Modern Python Advanced #4: Async in depth — event loop, gather/wait, async generator

The next step from intermediate intro — how the event loop actually works, the difference between Future and Task, gather vs wait, async generator, and async iteration.

Modern Python Advanced #3: Metaclasses — when do you really need them?
3 min read

Modern Python Advanced #3: Metaclasses — when do you really need them?

Classes that build classes — what type really is, division of labor with __init_subclass__, what class decorators can solve, and the narrow places where you really need a metaclass.

Modern Python Advanced #2: Descriptors and __set_name__
3 min read

Modern Python Advanced #2: Descriptors and __set_name__

How property works — the __get__/__set__ protocol and data/non-data descriptors, and clean validation fields with __set_name__.

Modern Python Advanced #1: Magic methods in depth and protocols
4 min read

Modern Python Advanced #1: Magic methods in depth and protocols

Every hook where Python objects integrate with language features — __call__, __getitem__, __hash__, __format__, __getattr__ — gathered in one place.

Modern Python Intermediate #7: Async intro (asyncio)
3 min read

Modern Python Intermediate #7: Async intro (asyncio)

Meaning of async/await, the event loop, asyncio.gather and TaskGroup, and mixing with sync code — a first step into asyncio in one place.

Modern Python Intermediate #6: Pattern matching in depth
4 min read

Modern Python Intermediate #6: Pattern matching in depth

The next step from basics match-case — class patterns and __match_args__, sequence/mapping patterns, captures and guards, plus anti-patterns.

Modern Python Intermediate #5: Decorator patterns
4 min read

Modern Python Intermediate #5: Decorator patterns

Every form of decorators that wrap functions — basic form, parameterized decorators, functools.wraps, class decorators, and ParamSpec.

Modern Python Intermediate #4: Iterables/generators/yield from
4 min read

Modern Python Intermediate #4: Iterables/generators/yield from

How for works — the iterable protocol, generator functions and expressions, delegation with yield from, and send/throw — all in one place.

Modern Python Intermediate #3: Context managers (with, contextlib)
6 min read

Modern Python Intermediate #3: Context managers (with, contextlib)

How with collapses try/finally, building your own context manager with __enter__/__exit__, the concise @contextmanager form, and practical tools like ExitStack and suppress.