@@ -134,10 +134,9 @@ Glossary
134134 For more information about descriptors' methods, see :ref: `descriptors `.
135135
136136 dictionary
137- An associative array, where arbitrary keys are mapped to values. The use
138- of :class: `dict ` closely resembles that for :class: `list `, but the keys can
139- be any object with a :meth: `__hash__ ` function, not just integers.
140- Called a hash in Perl.
137+ An associative array, where arbitrary keys are mapped to values. The keys
138+ can be any object with :meth: `__hash__ ` function and :meth: `__eq__ `
139+ methods. Called a hash in Perl.
141140
142141 docstring
143142 A string literal which appears as the first expression in a class,
@@ -186,17 +185,19 @@ Glossary
186185 :term: `abstract base class `.
187186
188187 floor division
189- Mathematical division discarding any remainder. The floor division
190- operator is ``// ``. For example, the expression ``11//4 `` evaluates to
191- ``2 `` in contrast to the ``2.75 `` returned by float true division.
188+ Mathematical division that rounds down to nearest integer. The floor
189+ division operator is ``// ``. For example, the expression ``11 // 4 ``
190+ evaluates to ``2 `` in contrast to the ``2.75 `` returned by float true
191+ division. Note that ``(-11) // 4 `` is ``-3 `` because that is ``-2.75 ``
192+ rounded *downward *. See :pep: `238 `.
192193
193194 function
194195 A series of statements which returns some value to a caller. It can also
195196 be passed zero or more arguments which may be used in the execution of
196197 the body. See also :term: `argument ` and :term: `method `.
197198
198199 __future__
199- A pseudo module which programmers can use to enable new language features
200+ A pseudo- module which programmers can use to enable new language features
200201 which are not compatible with the current interpreter.
201202
202203 By importing the :mod: `__future__ ` module and evaluating its variables,
@@ -214,13 +215,13 @@ Glossary
214215
215216 generator
216217 A function which returns an iterator. It looks like a normal function
217- except that values are returned to the caller using a :keyword: `yield `
218- statement instead of a :keyword: ` return ` statement. Generator functions
219- often contain one or more :keyword: ` for ` or :keyword: `while ` loops which
220- :keyword: ` yield ` elements back to the caller. The function execution is
221- stopped at the :keyword: ` yield ` keyword (returning the result) and is
222- resumed there when the next element is requested by calling the
223- :meth: ` __next__ ` method of the returned iterator .
218+ except that it contains :keyword: `yield ` statements for producing a series
219+ a values usable in a for-loop or that can be retrieved one at a time with
220+ the :func: ` next ` function. Each :keyword: `yield ` temporarily suspends
221+ processing, remembering the location execution state (including local
222+ variables and pending try-statements). When the generator resumes, it
223+ picks-up where it left-off (in contrast to functions which start fresh on
224+ every invocation .
224225
225226 .. index :: single: generator expression
226227
@@ -265,9 +266,7 @@ Glossary
265266 IDLE
266267 An Integrated Development Environment for Python. IDLE is a basic editor
267268 and interpreter environment which ships with the standard distribution of
268- Python. Good for beginners, it also serves as clear example code for
269- those wanting to implement a moderately sophisticated, multi-platform GUI
270- application.
269+ Python.
271270
272271 immutable
273272 An object with a fixed value. Immutable objects include numbers, strings and
@@ -369,7 +368,8 @@ Glossary
369368
370369 mapping
371370 A container object (such as :class: `dict `) which supports arbitrary key
372- lookups using the special method :meth: `__getitem__ `.
371+ lookups using the special method :meth: `__getitem__ `. Mappings also
372+ support :meth: `__len__ `, :meth: `__iter__ `, and :meth: `__contains__ `.
373373
374374 metaclass
375375 The class of a class. Class definitions create a class name, a class
0 commit comments