@@ -15,6 +15,17 @@ Glossary
1515 ``... ``
1616 The typical Python prompt of the interactive shell when entering code for
1717 an indented code block.
18+
19+ argument
20+ A value passed to a function or method, assigned to a name local to
21+ the body. A function or method may have both positional arguments and
22+ keyword arguments in its definition. Positional and keyword arguments
23+ may be variable-length: ``* `` accepts or passes (if in the function
24+ definition or call) several positional arguments in a list, while ``** ``
25+ does the same for keyword arguments in a dictionary.
26+
27+ Any expression may be used within the argument list, and the evaluated
28+ value is passed to the local variable.
1829
1930 BDFL
2031 Benevolent Dictator For Life, a.k.a. `Guido van Rossum
@@ -57,6 +68,22 @@ Glossary
5768 advanced mathematical feature. If you're not aware of a need for them,
5869 it's almost certain you can safely ignore them.
5970
71+ decorator
72+ A function returning another function, usually applied as a function
73+ transformation using the ``@wrapper `` syntax. Common examples for
74+ decorators are :func: `classmethod ` and :func: `staticmethod `.
75+
76+ The decorator syntax is merely syntactic sugar, the following two
77+ function definitions are semantically equivalent::
78+
79+ def f(...):
80+ ...
81+ f = staticmethod(f)
82+
83+ @staticmethod
84+ def f(...):
85+ ...
86+
6087 descriptor
6188 Any *new-style * object that defines the methods :meth: `__get__ `,
6289 :meth: `__set__ `, or :meth: `__delete__ `. When a class attribute is a
@@ -94,10 +121,24 @@ Glossary
94121 statements. The technique contrasts with the :term: `LBYL ` style that is
95122 common in many other languages such as C.
96123
124+ expression
125+ A piece of syntax which can be evaluated to some value. In other words,
126+ an expression is an accumulation of expression elements like literals, names,
127+ attribute access, operators or function calls that all return a value.
128+ In contrast to other languages, not all language constructs are expressions,
129+ but there are also :term: `statement `\s that cannot be used as expressions,
130+ such as :keyword: `print ` or :keyword: `if `. Assignments are also not
131+ expressions.
132+
97133 extension module
98134 A module written in C, using Python's C API to interact with the core and
99135 with user code.
100-
136+
137+ function
138+ A series of statements which returns some value to a caller. It can also
139+ be passed zero or more arguments which may be used in the execution of
140+ the body. See also :term: `argument ` and :term: `method `.
141+
101142 __future__
102143 A pseudo module which programmers can use to enable new language features
103144 which are not compatible with the current interpreter. For example, the
@@ -241,6 +282,17 @@ Glossary
241282
242283 More information can be found in :ref: `typeiter `.
243284
285+ keyword argument
286+ Arguments which are preceded with a ``variable_name= `` in the call.
287+ The variable name designates the local name in the function to which the
288+ value is assigned. ``** `` is used to accept or pass a dictionary of
289+ keyword arguments. See :term: `argument `.
290+
291+ lambda
292+ An anonymous inline function consisting of a single :term: `expression `
293+ which is evaluated when the function is called. The syntax to create
294+ a lambda function is ``lambda [arguments]: expression ``
295+
244296 LBYL
245297 Look before you leap. This coding style explicitly tests for
246298 pre-conditions before making calls or lookups. This style contrasts with
@@ -271,6 +323,12 @@ Glossary
271323 singletons, and many other tasks.
272324
273325 More information can be found in :ref: `metaclasses `.
326+
327+ method
328+ A function that is defined inside a class body. If called as an attribute
329+ of an instance of that class, the method will get the instance object as
330+ its first :term: `argument ` (which is usually called ``self ``).
331+ See :term: `function ` and :term: `nested scope `.
274332
275333 mutable
276334 Mutable objects can change their value but keep their :func: `id `. See
@@ -305,10 +363,32 @@ Glossary
305363
306364 More information can be found in :ref: `newstyle `.
307365
366+ positional argument
367+ The arguments assigned to local names inside a function or method,
368+ determined by the order in which they were given in the call. ``* `` is
369+ used to either accept multiple positional arguments (when in the
370+ definition), or pass several arguments as a list to a function. See
371+ :term: `argument `.
372+
308373 Python 3000
309374 Nickname for the next major Python version, 3.0 (coined long ago when the
310375 release of version 3 was something in the distant future.)
311376
377+ Pythonic
378+ An idea or piece of code which closely follows the most common idioms of
379+ the Python language, rather than implementing code using concepts common
380+ in other languages. For example, a common idiom in Python is the :keyword: `for `
381+ loop structure; other languages don't have this easy keyword, so people
382+ use a numerical counter instead::
383+
384+ for i in range(len(food)):
385+ print food[i]
386+
387+ As opposed to the cleaner, Pythonic method::
388+
389+ for piece in food:
390+ print piece
391+
312392 reference count
313393 The number of places where a certain object is referenced to. When the
314394 reference count drops to zero, an object is deallocated. While reference
@@ -331,6 +411,18 @@ Glossary
331411 mapping rather than a sequence because the lookups use arbitrary
332412 :term: `immutable ` keys rather than integers.
333413
414+ slice
415+ A list containing a portion of an indexed list-like object. A slice is
416+ created using the subscript notation, ``[] `` with colons between numbers
417+ when several are given, such as in ``variable_name[1:3:5] ``. The bracket
418+ (subscript) notation uses :class: `slice ` objects internally (or in older
419+ versions, :meth: `__getslice__ ` and :meth: `__setslice__ `).
420+
421+ statement
422+ A statement is part of a suite (a "block" of code). A statement is either
423+ an :term: `expression ` or a one of several constructs with a keyword, such
424+ as :keyword: `if `, :keyword: `while ` or :keyword: `print `.
425+
334426 type
335427 The type of a Python object determines what kind of object it is; every
336428 object has a type. An object's type is accessible as its
0 commit comments