Python Glossary
Pythonic jargon — words that come up in books, talks, and code review comments. Learn them once and the docs make a lot more sense.
The big ones
| Term | Means |
|---|---|
| Pythonic | Idiomatic — written the way a fluent Python coder would. |
| Duck typing | "If it quacks like a duck…" — accept anything with the right methods, regardless of type. |
| EAFP | "Easier to Ask Forgiveness than Permission" — try the operation; catch if it fails. |
| LBYL | "Look Before You Leap" — check preconditions first. Less Pythonic than EAFP. |
| Dunder | "Double underscore" name like __init__ or __len__. Wires into a protocol. |
| Iterable | Anything you can for-loop over. |
| Iterator | Stateful object that produces values one at a time (__next__). |
| Generator | Function with yield — produces an iterator. |
| Decorator | Function that wraps another function, used with @ syntax. |
| Context manager | Object usable with with — has __enter__ and __exit__. |
| Hashable | Has a stable __hash__ — can be a dict key or set member. Immutables qualify. |
| Mutable / Immutable | Can / can't be changed after creation. |
| GIL | Global Interpreter Lock — only one Python thread runs Python bytecode at a time. Threads still help I/O, not CPU. |
| Coroutine | Function declared async def; runs cooperatively via an event loop. |
| REPL | Read–Eval–Print Loop — the interactive python prompt. |
| venv | Virtual environment — project-local Python install. |
| PEP | Python Enhancement Proposal — design doc. PEP 8 is the style guide. |
| Type hint | Optional annotation read by tools (mypy, pyright); not enforced at runtime. |
| Slicing | s[start:stop:step] on any sequence. |
| Comprehension | [expr for x in iter if cond] — concise builder syntax. |
| Walrus | The := operator (assignment in an expression). |
Tip: Two phrases keep coming up: "There should be one — and preferably only one — obvious way to do it" and "flat is better than nested". Both are from
import this — the Zen of Python.Example
Example
# Some Python jargon worth knowing:
# - dunder: a double-underscore name like __init__
# - iterable: anything you can loop over
# - generator: a function with yield
# - decorator: function that wraps a function
# - context manager: works with 'with'
print('See the matching lesson for each.')
Try it Yourself »
Exercise
A "dunder" name has double-…
double-
10 letters.
Discussion
Loading…