Skip to content

Commit 25ae1af

Browse files
[3.14] Docs: add dunder and walrus to the glossary (GH-137430) (#137434)
Co-authored-by: Ned Batchelder <[email protected]>
1 parent 3a1e582 commit 25ae1af

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

Doc/glossary.rst

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -435,6 +435,11 @@ Glossary
435435
with :term:`abstract base classes <abstract base class>`.) Instead, it
436436
typically employs :func:`hasattr` tests or :term:`EAFP` programming.
437437

438+
dunder
439+
An informal short-hand for "double underscore", used when talking about a
440+
:term:`special method`. For example, ``__init__`` is often pronounced
441+
"dunder init".
442+
438443
EAFP
439444
Easier to ask for forgiveness than permission. This common Python coding
440445
style assumes the existence of valid keys or attributes and catches
@@ -1472,6 +1477,11 @@ Glossary
14721477
A computer defined entirely in software. Python's virtual machine
14731478
executes the :term:`bytecode` emitted by the bytecode compiler.
14741479

1480+
walrus operator
1481+
A light-hearted way to refer to the :ref:`assignment expression
1482+
<assignment-expressions>` operator ``:=`` because it looks a bit like a
1483+
walrus if you turn your head.
1484+
14751485
Zen of Python
14761486
Listing of Python design principles and philosophies that are helpful in
14771487
understanding and using the language. The listing can be found by typing

0 commit comments

Comments
 (0)