Python Generators: Lazy Iteration with yield
How yield turns a function into a generator, why generators use almost no memory, and how to build lazy data pipelines with them in Python.
Archive
Every tutorial we've published, newest first. Filter by topic or level to find exactly what you need.
How yield turns a function into a generator, why generators use almost no memory, and how to build lazy data pipelines with them in Python.
What a closure really is, how a JavaScript function keeps its variables after the outer function returns, and the patterns and bugs closures cause.
Most shell scripts work fine until a file name has a space in it or a command fails halfway through. Learn strict mode, quoting, safe temporary files and cleanup traps, then put it all together in a real backup script.
Why does a resolved promise always beat setTimeout(fn, 0)? Learn exactly how the event loop schedules tasks, microtasks and repaints, and how to keep long work from freezing the page.
When two CSS rules disagree, the browser follows a strict set of rules to pick a winner. Learn how the cascade decides, calculate specificity by hand, and stop reaching for !important.
GROUP BY squashes rows together; window functions calculate across rows and keep every one of them. Learn OVER, PARTITION BY, ROW_NUMBER, RANK, LAG and window frames with small, runnable examples.
Learn how B-tree indexes really work, read query plans with EXPLAIN, choose the right column order for composite indexes, and spot the mistakes that silently disable an index.
@property, bound methods, cached_property and __slots__ all run on one small protocol. Learn how descriptors work, the exact attribute lookup order, and how to write your own.
What really happens when you run a command: fork and exec, exit codes and wait, how signals stop programs (and how to shut down gracefully), why zombies appear, and why PID 1 in a container ignores your Ctrl+C.
Turn a messy trail of WIP commits into a clean, reviewable history with git rebase -i. Squash, reword, reorder, split and drop commits, and let fixup commits do the cleanup for you.
Open the .git folder and see Git for what it is: a content-addressed object store with movable pointers on top. Build a commit by hand and finally understand rebase, reset and the reflog.
Implement Dijkstra's shortest-path algorithm in Python with heapq, trace it step by step, understand why it's correct, and learn exactly when it breaks: negative edges, ties in the heap and dense graphs.
z-index isn't a global ranking. It only compares elements inside the same stacking context, and a dozen properties quietly create new ones. Learn the painting order, find the context that traps your element, and fix overlap bugs for good.
Binary search is easy to explain and surprisingly easy to get wrong. Learn one loop invariant that makes it correct every time, find first and last positions, and use binary search on answers instead of arrays.
Learn how list comprehensions work, when they make your code clearer, and when a plain for-loop is still the better choice.
A practical guide to promises and async/await: how they work, how to handle errors, and how to run tasks in parallel without slowing your app down.
Stop committing everything to main. Learn a simple, team-friendly branching workflow with feature branches, pull requests and clean merges.
Understand time complexity without the maths anxiety. We'll analyse real Python functions and see why O(n²) code falls apart at scale.
Flexbox and Grid both lay out elements, but they think differently. Learn the one-dimension vs two-dimension rule and build real layouts with each.
INNER, LEFT, RIGHT and FULL joins demystified with two tiny tables. See exactly which rows each join returns, and why.
Navigate, search, inspect and manage a Linux system with confidence. A practical tour of the commands developers reach for every day.
Decorators look like magic, but they're just functions that wrap functions. Build your own timing and retry decorators from scratch.
No articles match those filters yet. Try a different combination.