1.. _glossary: 2 3******** 4Glossary 5******** 6 7.. if you add new entries, keep the alphabetical sorting! 8 9.. glossary:: 10 11 ``>>>`` 12 The default Python prompt of the interactive shell. Often seen for code 13 examples which can be executed interactively in the interpreter. 14 15 ``...`` 16 Can refer to: 17 18 * The default Python prompt of the interactive shell when entering the 19 code for an indented code block, when within a pair of matching left and 20 right delimiters (parentheses, square brackets, curly braces or triple 21 quotes), or after specifying a decorator. 22 23 * The :const:`Ellipsis` built-in constant. 24 25 2to3 26 A tool that tries to convert Python 2.x code to Python 3.x code by 27 handling most of the incompatibilities which can be detected by parsing the 28 source and traversing the parse tree. 29 30 2to3 is available in the standard library as :mod:`lib2to3`; a standalone 31 entry point is provided as :file:`Tools/scripts/2to3`. See 32 :ref:`2to3-reference`. 33 34 abstract base class 35 Abstract base classes complement :term:`duck-typing` by 36 providing a way to define interfaces when other techniques like 37 :func:`hasattr` would be clumsy or subtly wrong (for example with 38 :ref:`magic methods <special-lookup>`). ABCs introduce virtual 39 subclasses, which are classes that don't inherit from a class but are 40 still recognized by :func:`isinstance` and :func:`issubclass`; see the 41 :mod:`abc` module documentation. Python comes with many built-in ABCs for 42 data structures (in the :mod:`collections.abc` module), numbers (in the 43 :mod:`numbers` module), streams (in the :mod:`io` module), import finders 44 and loaders (in the :mod:`importlib.abc` module). You can create your own 45 ABCs with the :mod:`abc` module. 46 47 annotation 48 A label associated with a variable, a class 49 attribute or a function parameter or return value, 50 used by convention as a :term:`type hint`. 51 52 Annotations of local variables cannot be accessed at runtime, but 53 annotations of global variables, class attributes, and functions 54 are stored in the :attr:`__annotations__` 55 special attribute of modules, classes, and functions, 56 respectively. 57 58 See :term:`variable annotation`, :term:`function annotation`, :pep:`484` 59 and :pep:`526`, which describe this functionality. 60 Also see :ref:`annotations-howto` 61 for best practices on working with annotations. 62 63 argument 64 A value passed to a :term:`function` (or :term:`method`) when calling the 65 function. There are two kinds of argument: 66 67 * :dfn:`keyword argument`: an argument preceded by an identifier (e.g. 68 ``name=``) in a function call or passed as a value in a dictionary 69 preceded by ``**``. For example, ``3`` and ``5`` are both keyword 70 arguments in the following calls to :func:`complex`:: 71 72 complex(real=3, imag=5) 73 complex(**{'real': 3, 'imag': 5}) 74 75 * :dfn:`positional argument`: an argument that is not a keyword argument. 76 Positional arguments can appear at the beginning of an argument list 77 and/or be passed as elements of an :term:`iterable` preceded by ``*``. 78 For example, ``3`` and ``5`` are both positional arguments in the 79 following calls:: 80 81 complex(3, 5) 82 complex(*(3, 5)) 83 84 Arguments are assigned to the named local variables in a function body. 85 See the :ref:`calls` section for the rules governing this assignment. 86 Syntactically, any expression can be used to represent an argument; the 87 evaluated value is assigned to the local variable. 88 89 See also the :term:`parameter` glossary entry, the FAQ question on 90 :ref:`the difference between arguments and parameters 91 <faq-argument-vs-parameter>`, and :pep:`362`. 92 93 asynchronous context manager 94 An object which controls the environment seen in an 95 :keyword:`async with` statement by defining :meth:`__aenter__` and 96 :meth:`__aexit__` methods. Introduced by :pep:`492`. 97 98 asynchronous generator 99 A function which returns an :term:`asynchronous generator iterator`. It 100 looks like a coroutine function defined with :keyword:`async def` except 101 that it contains :keyword:`yield` expressions for producing a series of 102 values usable in an :keyword:`async for` loop. 103 104 Usually refers to an asynchronous generator function, but may refer to an 105 *asynchronous generator iterator* in some contexts. In cases where the 106 intended meaning isn't clear, using the full terms avoids ambiguity. 107 108 An asynchronous generator function may contain :keyword:`await` 109 expressions as well as :keyword:`async for`, and :keyword:`async with` 110 statements. 111 112 asynchronous generator iterator 113 An object created by a :term:`asynchronous generator` function. 114 115 This is an :term:`asynchronous iterator` which when called using the 116 :meth:`__anext__` method returns an awaitable object which will execute 117 the body of the asynchronous generator function until the next 118 :keyword:`yield` expression. 119 120 Each :keyword:`yield` temporarily suspends processing, remembering the 121 location execution state (including local variables and pending 122 try-statements). When the *asynchronous generator iterator* effectively 123 resumes with another awaitable returned by :meth:`__anext__`, it 124 picks up where it left off. See :pep:`492` and :pep:`525`. 125 126 asynchronous iterable 127 An object, that can be used in an :keyword:`async for` statement. 128 Must return an :term:`asynchronous iterator` from its 129 :meth:`__aiter__` method. Introduced by :pep:`492`. 130 131 asynchronous iterator 132 An object that implements the :meth:`__aiter__` and :meth:`__anext__` 133 methods. ``__anext__`` must return an :term:`awaitable` object. 134 :keyword:`async for` resolves the awaitables returned by an asynchronous 135 iterator's :meth:`__anext__` method until it raises a 136 :exc:`StopAsyncIteration` exception. Introduced by :pep:`492`. 137 138 attribute 139 A value associated with an object which is referenced by name using 140 dotted expressions. For example, if an object *o* has an attribute 141 *a* it would be referenced as *o.a*. 142 143 awaitable 144 An object that can be used in an :keyword:`await` expression. Can be 145 a :term:`coroutine` or an object with an :meth:`__await__` method. 146 See also :pep:`492`. 147 148 BDFL 149 Benevolent Dictator For Life, a.k.a. `Guido van Rossum 150 <https://gvanrossum.github.io/>`_, Python's creator. 151 152 binary file 153 A :term:`file object` able to read and write 154 :term:`bytes-like objects <bytes-like object>`. 155 Examples of binary files are files opened in binary mode (``'rb'``, 156 ``'wb'`` or ``'rb+'``), :data:`sys.stdin.buffer`, 157 :data:`sys.stdout.buffer`, and instances of :class:`io.BytesIO` and 158 :class:`gzip.GzipFile`. 159 160 See also :term:`text file` for a file object able to read and write 161 :class:`str` objects. 162 163 borrowed reference 164 In Python's C API, a borrowed reference is a reference to an object. 165 It does not modify the object reference count. It becomes a dangling 166 pointer if the object is destroyed. For example, a garbage collection can 167 remove the last :term:`strong reference` to the object and so destroy it. 168 169 Calling :c:func:`Py_INCREF` on the :term:`borrowed reference` is 170 recommended to convert it to a :term:`strong reference` in-place, except 171 when the object cannot be destroyed before the last usage of the borrowed 172 reference. The :c:func:`Py_NewRef` function can be used to create a new 173 :term:`strong reference`. 174 175 bytes-like object 176 An object that supports the :ref:`bufferobjects` and can 177 export a C-:term:`contiguous` buffer. This includes all :class:`bytes`, 178 :class:`bytearray`, and :class:`array.array` objects, as well as many 179 common :class:`memoryview` objects. Bytes-like objects can 180 be used for various operations that work with binary data; these include 181 compression, saving to a binary file, and sending over a socket. 182 183 Some operations need the binary data to be mutable. The documentation 184 often refers to these as "read-write bytes-like objects". Example 185 mutable buffer objects include :class:`bytearray` and a 186 :class:`memoryview` of a :class:`bytearray`. 187 Other operations require the binary data to be stored in 188 immutable objects ("read-only bytes-like objects"); examples 189 of these include :class:`bytes` and a :class:`memoryview` 190 of a :class:`bytes` object. 191 192 bytecode 193 Python source code is compiled into bytecode, the internal representation 194 of a Python program in the CPython interpreter. The bytecode is also 195 cached in ``.pyc`` files so that executing the same file is 196 faster the second time (recompilation from source to bytecode can be 197 avoided). This "intermediate language" is said to run on a 198 :term:`virtual machine` that executes the machine code corresponding to 199 each bytecode. Do note that bytecodes are not expected to work between 200 different Python virtual machines, nor to be stable between Python 201 releases. 202 203 A list of bytecode instructions can be found in the documentation for 204 :ref:`the dis module <bytecodes>`. 205 206 callback 207 A subroutine function which is passed as an argument to be executed at 208 some point in the future. 209 210 class 211 A template for creating user-defined objects. Class definitions 212 normally contain method definitions which operate on instances of the 213 class. 214 215 class variable 216 A variable defined in a class and intended to be modified only at 217 class level (i.e., not in an instance of the class). 218 219 coercion 220 The implicit conversion of an instance of one type to another during an 221 operation which involves two arguments of the same type. For example, 222 ``int(3.15)`` converts the floating point number to the integer ``3``, but 223 in ``3+4.5``, each argument is of a different type (one int, one float), 224 and both must be converted to the same type before they can be added or it 225 will raise a :exc:`TypeError`. Without coercion, all arguments of even 226 compatible types would have to be normalized to the same value by the 227 programmer, e.g., ``float(3)+4.5`` rather than just ``3+4.5``. 228 229 complex number 230 An extension of the familiar real number system in which all numbers are 231 expressed as a sum of a real part and an imaginary part. Imaginary 232 numbers are real multiples of the imaginary unit (the square root of 233 ``-1``), often written ``i`` in mathematics or ``j`` in 234 engineering. Python has built-in support for complex numbers, which are 235 written with this latter notation; the imaginary part is written with a 236 ``j`` suffix, e.g., ``3+1j``. To get access to complex equivalents of the 237 :mod:`math` module, use :mod:`cmath`. Use of complex numbers is a fairly 238 advanced mathematical feature. If you're not aware of a need for them, 239 it's almost certain you can safely ignore them. 240 241 context manager 242 An object which controls the environment seen in a :keyword:`with` 243 statement by defining :meth:`__enter__` and :meth:`__exit__` methods. 244 See :pep:`343`. 245 246 context variable 247 A variable which can have different values depending on its context. 248 This is similar to Thread-Local Storage in which each execution 249 thread may have a different value for a variable. However, with context 250 variables, there may be several contexts in one execution thread and the 251 main usage for context variables is to keep track of variables in 252 concurrent asynchronous tasks. 253 See :mod:`contextvars`. 254 255 contiguous 256 .. index:: C-contiguous, Fortran contiguous 257 258 A buffer is considered contiguous exactly if it is either 259 *C-contiguous* or *Fortran contiguous*. Zero-dimensional buffers are 260 C and Fortran contiguous. In one-dimensional arrays, the items 261 must be laid out in memory next to each other, in order of 262 increasing indexes starting from zero. In multidimensional 263 C-contiguous arrays, the last index varies the fastest when 264 visiting items in order of memory address. However, in 265 Fortran contiguous arrays, the first index varies the fastest. 266 267 coroutine 268 Coroutines are a more generalized form of subroutines. Subroutines are 269 entered at one point and exited at another point. Coroutines can be 270 entered, exited, and resumed at many different points. They can be 271 implemented with the :keyword:`async def` statement. See also 272 :pep:`492`. 273 274 coroutine function 275 A function which returns a :term:`coroutine` object. A coroutine 276 function may be defined with the :keyword:`async def` statement, 277 and may contain :keyword:`await`, :keyword:`async for`, and 278 :keyword:`async with` keywords. These were introduced 279 by :pep:`492`. 280 281 CPython 282 The canonical implementation of the Python programming language, as 283 distributed on `python.org <https://www.python.org>`_. The term "CPython" 284 is used when necessary to distinguish this implementation from others 285 such as Jython or IronPython. 286 287 decorator 288 A function returning another function, usually applied as a function 289 transformation using the ``@wrapper`` syntax. Common examples for 290 decorators are :func:`classmethod` and :func:`staticmethod`. 291 292 The decorator syntax is merely syntactic sugar, the following two 293 function definitions are semantically equivalent:: 294 295 def f(...): 296 ... 297 f = staticmethod(f) 298 299 @staticmethod 300 def f(...): 301 ... 302 303 The same concept exists for classes, but is less commonly used there. See 304 the documentation for :ref:`function definitions <function>` and 305 :ref:`class definitions <class>` for more about decorators. 306 307 descriptor 308 Any object which defines the methods :meth:`__get__`, :meth:`__set__`, or 309 :meth:`__delete__`. When a class attribute is a descriptor, its special 310 binding behavior is triggered upon attribute lookup. Normally, using 311 *a.b* to get, set or delete an attribute looks up the object named *b* in 312 the class dictionary for *a*, but if *b* is a descriptor, the respective 313 descriptor method gets called. Understanding descriptors is a key to a 314 deep understanding of Python because they are the basis for many features 315 including functions, methods, properties, class methods, static methods, 316 and reference to super classes. 317 318 For more information about descriptors' methods, see :ref:`descriptors` 319 or the :ref:`Descriptor How To Guide <descriptorhowto>`. 320 321 dictionary 322 An associative array, where arbitrary keys are mapped to values. The 323 keys can be any object with :meth:`__hash__` and :meth:`__eq__` methods. 324 Called a hash in Perl. 325 326 dictionary comprehension 327 A compact way to process all or part of the elements in an iterable and 328 return a dictionary with the results. ``results = {n: n ** 2 for n in 329 range(10)}`` generates a dictionary containing key ``n`` mapped to 330 value ``n ** 2``. See :ref:`comprehensions`. 331 332 dictionary view 333 The objects returned from :meth:`dict.keys`, :meth:`dict.values`, and 334 :meth:`dict.items` are called dictionary views. They provide a dynamic 335 view on the dictionary’s entries, which means that when the dictionary 336 changes, the view reflects these changes. To force the 337 dictionary view to become a full list use ``list(dictview)``. See 338 :ref:`dict-views`. 339 340 docstring 341 A string literal which appears as the first expression in a class, 342 function or module. While ignored when the suite is executed, it is 343 recognized by the compiler and put into the :attr:`__doc__` attribute 344 of the enclosing class, function or module. Since it is available via 345 introspection, it is the canonical place for documentation of the 346 object. 347 348 duck-typing 349 A programming style which does not look at an object's type to determine 350 if it has the right interface; instead, the method or attribute is simply 351 called or used ("If it looks like a duck and quacks like a duck, it 352 must be a duck.") By emphasizing interfaces rather than specific types, 353 well-designed code improves its flexibility by allowing polymorphic 354 substitution. Duck-typing avoids tests using :func:`type` or 355 :func:`isinstance`. (Note, however, that duck-typing can be complemented 356 with :term:`abstract base classes <abstract base class>`.) Instead, it 357 typically employs :func:`hasattr` tests or :term:`EAFP` programming. 358 359 EAFP 360 Easier to ask for forgiveness than permission. This common Python coding 361 style assumes the existence of valid keys or attributes and catches 362 exceptions if the assumption proves false. This clean and fast style is 363 characterized by the presence of many :keyword:`try` and :keyword:`except` 364 statements. The technique contrasts with the :term:`LBYL` style 365 common to many other languages such as C. 366 367 expression 368 A piece of syntax which can be evaluated to some value. In other words, 369 an expression is an accumulation of expression elements like literals, 370 names, attribute access, operators or function calls which all return a 371 value. In contrast to many other languages, not all language constructs 372 are expressions. There are also :term:`statement`\s which cannot be used 373 as expressions, such as :keyword:`while`. Assignments are also statements, 374 not expressions. 375 376 extension module 377 A module written in C or C++, using Python's C API to interact with the 378 core and with user code. 379 380 f-string 381 String literals prefixed with ``'f'`` or ``'F'`` are commonly called 382 "f-strings" which is short for 383 :ref:`formatted string literals <f-strings>`. See also :pep:`498`. 384 385 file object 386 An object exposing a file-oriented API (with methods such as 387 :meth:`read()` or :meth:`write()`) to an underlying resource. Depending 388 on the way it was created, a file object can mediate access to a real 389 on-disk file or to another type of storage or communication device 390 (for example standard input/output, in-memory buffers, sockets, pipes, 391 etc.). File objects are also called :dfn:`file-like objects` or 392 :dfn:`streams`. 393 394 There are actually three categories of file objects: raw 395 :term:`binary files <binary file>`, buffered 396 :term:`binary files <binary file>` and :term:`text files <text file>`. 397 Their interfaces are defined in the :mod:`io` module. The canonical 398 way to create a file object is by using the :func:`open` function. 399 400 file-like object 401 A synonym for :term:`file object`. 402 403 filesystem encoding and error handler 404 Encoding and error handler used by Python to decode bytes from the 405 operating system and encode Unicode to the operating system. 406 407 The filesystem encoding must guarantee to successfully decode all bytes 408 below 128. If the file system encoding fails to provide this guarantee, 409 API functions can raise :exc:`UnicodeError`. 410 411 The :func:`sys.getfilesystemencoding` and 412 :func:`sys.getfilesystemencodeerrors` functions can be used to get the 413 filesystem encoding and error handler. 414 415 The :term:`filesystem encoding and error handler` are configured at 416 Python startup by the :c:func:`PyConfig_Read` function: see 417 :c:member:`~PyConfig.filesystem_encoding` and 418 :c:member:`~PyConfig.filesystem_errors` members of :c:type:`PyConfig`. 419 420 See also the :term:`locale encoding`. 421 422 finder 423 An object that tries to find the :term:`loader` for a module that is 424 being imported. 425 426 Since Python 3.3, there are two types of finder: :term:`meta path finders 427 <meta path finder>` for use with :data:`sys.meta_path`, and :term:`path 428 entry finders <path entry finder>` for use with :data:`sys.path_hooks`. 429 430 See :pep:`302`, :pep:`420` and :pep:`451` for much more detail. 431 432 floor division 433 Mathematical division that rounds down to nearest integer. The floor 434 division operator is ``//``. For example, the expression ``11 // 4`` 435 evaluates to ``2`` in contrast to the ``2.75`` returned by float true 436 division. Note that ``(-11) // 4`` is ``-3`` because that is ``-2.75`` 437 rounded *downward*. See :pep:`238`. 438 439 function 440 A series of statements which returns some value to a caller. It can also 441 be passed zero or more :term:`arguments <argument>` which may be used in 442 the execution of the body. See also :term:`parameter`, :term:`method`, 443 and the :ref:`function` section. 444 445 function annotation 446 An :term:`annotation` of a function parameter or return value. 447 448 Function annotations are usually used for 449 :term:`type hints <type hint>`: for example, this function is expected to take two 450 :class:`int` arguments and is also expected to have an :class:`int` 451 return value:: 452 453 def sum_two_numbers(a: int, b: int) -> int: 454 return a + b 455 456 Function annotation syntax is explained in section :ref:`function`. 457 458 See :term:`variable annotation` and :pep:`484`, 459 which describe this functionality. 460 Also see :ref:`annotations-howto` 461 for best practices on working with annotations. 462 463 __future__ 464 A :ref:`future statement <future>`, ``from __future__ import <feature>``, 465 directs the compiler to compile the current module using syntax or 466 semantics that will become standard in a future release of Python. 467 The :mod:`__future__` module documents the possible values of 468 *feature*. By importing this module and evaluating its variables, 469 you can see when a new feature was first added to the language and 470 when it will (or did) become the default:: 471 472 >>> import __future__ 473 >>> __future__.division 474 _Feature((2, 2, 0, 'alpha', 2), (3, 0, 0, 'alpha', 0), 8192) 475 476 garbage collection 477 The process of freeing memory when it is not used anymore. Python 478 performs garbage collection via reference counting and a cyclic garbage 479 collector that is able to detect and break reference cycles. The 480 garbage collector can be controlled using the :mod:`gc` module. 481 482 .. index:: single: generator 483 484 generator 485 A function which returns a :term:`generator iterator`. It looks like a 486 normal function except that it contains :keyword:`yield` expressions 487 for producing a series of values usable in a for-loop or that can be 488 retrieved one at a time with the :func:`next` function. 489 490 Usually refers to a generator function, but may refer to a 491 *generator iterator* in some contexts. In cases where the intended 492 meaning isn't clear, using the full terms avoids ambiguity. 493 494 generator iterator 495 An object created by a :term:`generator` function. 496 497 Each :keyword:`yield` temporarily suspends processing, remembering the 498 location execution state (including local variables and pending 499 try-statements). When the *generator iterator* resumes, it picks up where 500 it left off (in contrast to functions which start fresh on every 501 invocation). 502 503 .. index:: single: generator expression 504 505 generator expression 506 An expression that returns an iterator. It looks like a normal expression 507 followed by a :keyword:`!for` clause defining a loop variable, range, 508 and an optional :keyword:`!if` clause. The combined expression 509 generates values for an enclosing function:: 510 511 >>> sum(i*i for i in range(10)) # sum of squares 0, 1, 4, ... 81 512 285 513 514 generic function 515 A function composed of multiple functions implementing the same operation 516 for different types. Which implementation should be used during a call is 517 determined by the dispatch algorithm. 518 519 See also the :term:`single dispatch` glossary entry, the 520 :func:`functools.singledispatch` decorator, and :pep:`443`. 521 522 generic type 523 A :term:`type` that can be parameterized; typically a 524 :ref:`container class<sequence-types>` such as :class:`list` or 525 :class:`dict`. Used for :term:`type hints <type hint>` and 526 :term:`annotations <annotation>`. 527 528 For more details, see :ref:`generic alias types<types-genericalias>`, 529 :pep:`483`, :pep:`484`, :pep:`585`, and the :mod:`typing` module. 530 531 GIL 532 See :term:`global interpreter lock`. 533 534 global interpreter lock 535 The mechanism used by the :term:`CPython` interpreter to assure that 536 only one thread executes Python :term:`bytecode` at a time. 537 This simplifies the CPython implementation by making the object model 538 (including critical built-in types such as :class:`dict`) implicitly 539 safe against concurrent access. Locking the entire interpreter 540 makes it easier for the interpreter to be multi-threaded, at the 541 expense of much of the parallelism afforded by multi-processor 542 machines. 543 544 However, some extension modules, either standard or third-party, 545 are designed so as to release the GIL when doing computationally-intensive 546 tasks such as compression or hashing. Also, the GIL is always released 547 when doing I/O. 548 549 Past efforts to create a "free-threaded" interpreter (one which locks 550 shared data at a much finer granularity) have not been successful 551 because performance suffered in the common single-processor case. It 552 is believed that overcoming this performance issue would make the 553 implementation much more complicated and therefore costlier to maintain. 554 555 556 hash-based pyc 557 A bytecode cache file that uses the hash rather than the last-modified 558 time of the corresponding source file to determine its validity. See 559 :ref:`pyc-invalidation`. 560 561 hashable 562 An object is *hashable* if it has a hash value which never changes during 563 its lifetime (it needs a :meth:`__hash__` method), and can be compared to 564 other objects (it needs an :meth:`__eq__` method). Hashable objects which 565 compare equal must have the same hash value. 566 567 Hashability makes an object usable as a dictionary key and a set member, 568 because these data structures use the hash value internally. 569 570 Most of Python's immutable built-in objects are hashable; mutable 571 containers (such as lists or dictionaries) are not; immutable 572 containers (such as tuples and frozensets) are only hashable if 573 their elements are hashable. Objects which are 574 instances of user-defined classes are hashable by default. They all 575 compare unequal (except with themselves), and their hash value is derived 576 from their :func:`id`. 577 578 IDLE 579 An Integrated Development Environment for Python. IDLE is a basic editor 580 and interpreter environment which ships with the standard distribution of 581 Python. 582 583 immutable 584 An object with a fixed value. Immutable objects include numbers, strings and 585 tuples. Such an object cannot be altered. A new object has to 586 be created if a different value has to be stored. They play an important 587 role in places where a constant hash value is needed, for example as a key 588 in a dictionary. 589 590 import path 591 A list of locations (or :term:`path entries <path entry>`) that are 592 searched by the :term:`path based finder` for modules to import. During 593 import, this list of locations usually comes from :data:`sys.path`, but 594 for subpackages it may also come from the parent package's ``__path__`` 595 attribute. 596 597 importing 598 The process by which Python code in one module is made available to 599 Python code in another module. 600 601 importer 602 An object that both finds and loads a module; both a 603 :term:`finder` and :term:`loader` object. 604 605 interactive 606 Python has an interactive interpreter which means you can enter 607 statements and expressions at the interpreter prompt, immediately 608 execute them and see their results. Just launch ``python`` with no 609 arguments (possibly by selecting it from your computer's main 610 menu). It is a very powerful way to test out new ideas or inspect 611 modules and packages (remember ``help(x)``). 612 613 interpreted 614 Python is an interpreted language, as opposed to a compiled one, 615 though the distinction can be blurry because of the presence of the 616 bytecode compiler. This means that source files can be run directly 617 without explicitly creating an executable which is then run. 618 Interpreted languages typically have a shorter development/debug cycle 619 than compiled ones, though their programs generally also run more 620 slowly. See also :term:`interactive`. 621 622 interpreter shutdown 623 When asked to shut down, the Python interpreter enters a special phase 624 where it gradually releases all allocated resources, such as modules 625 and various critical internal structures. It also makes several calls 626 to the :term:`garbage collector <garbage collection>`. This can trigger 627 the execution of code in user-defined destructors or weakref callbacks. 628 Code executed during the shutdown phase can encounter various 629 exceptions as the resources it relies on may not function anymore 630 (common examples are library modules or the warnings machinery). 631 632 The main reason for interpreter shutdown is that the ``__main__`` module 633 or the script being run has finished executing. 634 635 iterable 636 An object capable of returning its members one at a time. Examples of 637 iterables include all sequence types (such as :class:`list`, :class:`str`, 638 and :class:`tuple`) and some non-sequence types like :class:`dict`, 639 :term:`file objects <file object>`, and objects of any classes you define 640 with an :meth:`__iter__` method or with a :meth:`__getitem__` method 641 that implements :term:`Sequence <sequence>` semantics. 642 643 Iterables can be 644 used in a :keyword:`for` loop and in many other places where a sequence is 645 needed (:func:`zip`, :func:`map`, ...). When an iterable object is passed 646 as an argument to the built-in function :func:`iter`, it returns an 647 iterator for the object. This iterator is good for one pass over the set 648 of values. When using iterables, it is usually not necessary to call 649 :func:`iter` or deal with iterator objects yourself. The ``for`` 650 statement does that automatically for you, creating a temporary unnamed 651 variable to hold the iterator for the duration of the loop. See also 652 :term:`iterator`, :term:`sequence`, and :term:`generator`. 653 654 iterator 655 An object representing a stream of data. Repeated calls to the iterator's 656 :meth:`~iterator.__next__` method (or passing it to the built-in function 657 :func:`next`) return successive items in the stream. When no more data 658 are available a :exc:`StopIteration` exception is raised instead. At this 659 point, the iterator object is exhausted and any further calls to its 660 :meth:`__next__` method just raise :exc:`StopIteration` again. Iterators 661 are required to have an :meth:`__iter__` method that returns the iterator 662 object itself so every iterator is also iterable and may be used in most 663 places where other iterables are accepted. One notable exception is code 664 which attempts multiple iteration passes. A container object (such as a 665 :class:`list`) produces a fresh new iterator each time you pass it to the 666 :func:`iter` function or use it in a :keyword:`for` loop. Attempting this 667 with an iterator will just return the same exhausted iterator object used 668 in the previous iteration pass, making it appear like an empty container. 669 670 More information can be found in :ref:`typeiter`. 671 672 .. impl-detail:: 673 674 CPython does not consistently apply the requirement that an iterator 675 define :meth:`__iter__`. 676 677 key function 678 A key function or collation function is a callable that returns a value 679 used for sorting or ordering. For example, :func:`locale.strxfrm` is 680 used to produce a sort key that is aware of locale specific sort 681 conventions. 682 683 A number of tools in Python accept key functions to control how elements 684 are ordered or grouped. They include :func:`min`, :func:`max`, 685 :func:`sorted`, :meth:`list.sort`, :func:`heapq.merge`, 686 :func:`heapq.nsmallest`, :func:`heapq.nlargest`, and 687 :func:`itertools.groupby`. 688 689 There are several ways to create a key function. For example. the 690 :meth:`str.lower` method can serve as a key function for case insensitive 691 sorts. Alternatively, a key function can be built from a 692 :keyword:`lambda` expression such as ``lambda r: (r[0], r[2])``. Also, 693 the :mod:`operator` module provides three key function constructors: 694 :func:`~operator.attrgetter`, :func:`~operator.itemgetter`, and 695 :func:`~operator.methodcaller`. See the :ref:`Sorting HOW TO 696 <sortinghowto>` for examples of how to create and use key functions. 697 698 keyword argument 699 See :term:`argument`. 700 701 lambda 702 An anonymous inline function consisting of a single :term:`expression` 703 which is evaluated when the function is called. The syntax to create 704 a lambda function is ``lambda [parameters]: expression`` 705 706 LBYL 707 Look before you leap. This coding style explicitly tests for 708 pre-conditions before making calls or lookups. This style contrasts with 709 the :term:`EAFP` approach and is characterized by the presence of many 710 :keyword:`if` statements. 711 712 In a multi-threaded environment, the LBYL approach can risk introducing a 713 race condition between "the looking" and "the leaping". For example, the 714 code, ``if key in mapping: return mapping[key]`` can fail if another 715 thread removes *key* from *mapping* after the test, but before the lookup. 716 This issue can be solved with locks or by using the EAFP approach. 717 718 locale encoding 719 On Unix, it is the encoding of the LC_CTYPE locale. It can be set with 720 ``locale.setlocale(locale.LC_CTYPE, new_locale)``. 721 722 On Windows, it is the ANSI code page (ex: ``cp1252``). 723 724 ``locale.getpreferredencoding(False)`` can be used to get the locale 725 encoding. 726 727 Python uses the :term:`filesystem encoding and error handler` to convert 728 between Unicode filenames and bytes filenames. 729 730 list 731 A built-in Python :term:`sequence`. Despite its name it is more akin 732 to an array in other languages than to a linked list since access to 733 elements is O(1). 734 735 list comprehension 736 A compact way to process all or part of the elements in a sequence and 737 return a list with the results. ``result = ['{:#04x}'.format(x) for x in 738 range(256) if x % 2 == 0]`` generates a list of strings containing 739 even hex numbers (0x..) in the range from 0 to 255. The :keyword:`if` 740 clause is optional. If omitted, all elements in ``range(256)`` are 741 processed. 742 743 loader 744 An object that loads a module. It must define a method named 745 :meth:`load_module`. A loader is typically returned by a 746 :term:`finder`. See :pep:`302` for details and 747 :class:`importlib.abc.Loader` for an :term:`abstract base class`. 748 749 magic method 750 .. index:: pair: magic; method 751 752 An informal synonym for :term:`special method`. 753 754 mapping 755 A container object that supports arbitrary key lookups and implements the 756 methods specified in the :class:`~collections.abc.Mapping` or 757 :class:`~collections.abc.MutableMapping` 758 :ref:`abstract base classes <collections-abstract-base-classes>`. Examples 759 include :class:`dict`, :class:`collections.defaultdict`, 760 :class:`collections.OrderedDict` and :class:`collections.Counter`. 761 762 meta path finder 763 A :term:`finder` returned by a search of :data:`sys.meta_path`. Meta path 764 finders are related to, but different from :term:`path entry finders 765 <path entry finder>`. 766 767 See :class:`importlib.abc.MetaPathFinder` for the methods that meta path 768 finders implement. 769 770 metaclass 771 The class of a class. Class definitions create a class name, a class 772 dictionary, and a list of base classes. The metaclass is responsible for 773 taking those three arguments and creating the class. Most object oriented 774 programming languages provide a default implementation. What makes Python 775 special is that it is possible to create custom metaclasses. Most users 776 never need this tool, but when the need arises, metaclasses can provide 777 powerful, elegant solutions. They have been used for logging attribute 778 access, adding thread-safety, tracking object creation, implementing 779 singletons, and many other tasks. 780 781 More information can be found in :ref:`metaclasses`. 782 783 method 784 A function which is defined inside a class body. If called as an attribute 785 of an instance of that class, the method will get the instance object as 786 its first :term:`argument` (which is usually called ``self``). 787 See :term:`function` and :term:`nested scope`. 788 789 method resolution order 790 Method Resolution Order is the order in which base classes are searched 791 for a member during lookup. See `The Python 2.3 Method Resolution Order 792 <https://www.python.org/download/releases/2.3/mro/>`_ for details of the 793 algorithm used by the Python interpreter since the 2.3 release. 794 795 module 796 An object that serves as an organizational unit of Python code. Modules 797 have a namespace containing arbitrary Python objects. Modules are loaded 798 into Python by the process of :term:`importing`. 799 800 See also :term:`package`. 801 802 module spec 803 A namespace containing the import-related information used to load a 804 module. An instance of :class:`importlib.machinery.ModuleSpec`. 805 806 MRO 807 See :term:`method resolution order`. 808 809 mutable 810 Mutable objects can change their value but keep their :func:`id`. See 811 also :term:`immutable`. 812 813 named tuple 814 The term "named tuple" applies to any type or class that inherits from 815 tuple and whose indexable elements are also accessible using named 816 attributes. The type or class may have other features as well. 817 818 Several built-in types are named tuples, including the values returned 819 by :func:`time.localtime` and :func:`os.stat`. Another example is 820 :data:`sys.float_info`:: 821 822 >>> sys.float_info[1] # indexed access 823 1024 824 >>> sys.float_info.max_exp # named field access 825 1024 826 >>> isinstance(sys.float_info, tuple) # kind of tuple 827 True 828 829 Some named tuples are built-in types (such as the above examples). 830 Alternatively, a named tuple can be created from a regular class 831 definition that inherits from :class:`tuple` and that defines named 832 fields. Such a class can be written by hand or it can be created with 833 the factory function :func:`collections.namedtuple`. The latter 834 technique also adds some extra methods that may not be found in 835 hand-written or built-in named tuples. 836 837 namespace 838 The place where a variable is stored. Namespaces are implemented as 839 dictionaries. There are the local, global and built-in namespaces as well 840 as nested namespaces in objects (in methods). Namespaces support 841 modularity by preventing naming conflicts. For instance, the functions 842 :func:`builtins.open <.open>` and :func:`os.open` are distinguished by 843 their namespaces. Namespaces also aid readability and maintainability by 844 making it clear which module implements a function. For instance, writing 845 :func:`random.seed` or :func:`itertools.islice` makes it clear that those 846 functions are implemented by the :mod:`random` and :mod:`itertools` 847 modules, respectively. 848 849 namespace package 850 A :pep:`420` :term:`package` which serves only as a container for 851 subpackages. Namespace packages may have no physical representation, 852 and specifically are not like a :term:`regular package` because they 853 have no ``__init__.py`` file. 854 855 See also :term:`module`. 856 857 nested scope 858 The ability to refer to a variable in an enclosing definition. For 859 instance, a function defined inside another function can refer to 860 variables in the outer function. Note that nested scopes by default work 861 only for reference and not for assignment. Local variables both read and 862 write in the innermost scope. Likewise, global variables read and write 863 to the global namespace. The :keyword:`nonlocal` allows writing to outer 864 scopes. 865 866 new-style class 867 Old name for the flavor of classes now used for all class objects. In 868 earlier Python versions, only new-style classes could use Python's newer, 869 versatile features like :attr:`~object.__slots__`, descriptors, 870 properties, :meth:`__getattribute__`, class methods, and static methods. 871 872 object 873 Any data with state (attributes or value) and defined behavior 874 (methods). Also the ultimate base class of any :term:`new-style 875 class`. 876 877 package 878 A Python :term:`module` which can contain submodules or recursively, 879 subpackages. Technically, a package is a Python module with an 880 ``__path__`` attribute. 881 882 See also :term:`regular package` and :term:`namespace package`. 883 884 parameter 885 A named entity in a :term:`function` (or method) definition that 886 specifies an :term:`argument` (or in some cases, arguments) that the 887 function can accept. There are five kinds of parameter: 888 889 * :dfn:`positional-or-keyword`: specifies an argument that can be passed 890 either :term:`positionally <argument>` or as a :term:`keyword argument 891 <argument>`. This is the default kind of parameter, for example *foo* 892 and *bar* in the following:: 893 894 def func(foo, bar=None): ... 895 896 .. _positional-only_parameter: 897 898 * :dfn:`positional-only`: specifies an argument that can be supplied only 899 by position. Positional-only parameters can be defined by including a 900 ``/`` character in the parameter list of the function definition after 901 them, for example *posonly1* and *posonly2* in the following:: 902 903 def func(posonly1, posonly2, /, positional_or_keyword): ... 904 905 .. _keyword-only_parameter: 906 907 * :dfn:`keyword-only`: specifies an argument that can be supplied only 908 by keyword. Keyword-only parameters can be defined by including a 909 single var-positional parameter or bare ``*`` in the parameter list 910 of the function definition before them, for example *kw_only1* and 911 *kw_only2* in the following:: 912 913 def func(arg, *, kw_only1, kw_only2): ... 914 915 * :dfn:`var-positional`: specifies that an arbitrary sequence of 916 positional arguments can be provided (in addition to any positional 917 arguments already accepted by other parameters). Such a parameter can 918 be defined by prepending the parameter name with ``*``, for example 919 *args* in the following:: 920 921 def func(*args, **kwargs): ... 922 923 * :dfn:`var-keyword`: specifies that arbitrarily many keyword arguments 924 can be provided (in addition to any keyword arguments already accepted 925 by other parameters). Such a parameter can be defined by prepending 926 the parameter name with ``**``, for example *kwargs* in the example 927 above. 928 929 Parameters can specify both optional and required arguments, as well as 930 default values for some optional arguments. 931 932 See also the :term:`argument` glossary entry, the FAQ question on 933 :ref:`the difference between arguments and parameters 934 <faq-argument-vs-parameter>`, the :class:`inspect.Parameter` class, the 935 :ref:`function` section, and :pep:`362`. 936 937 path entry 938 A single location on the :term:`import path` which the :term:`path 939 based finder` consults to find modules for importing. 940 941 path entry finder 942 A :term:`finder` returned by a callable on :data:`sys.path_hooks` 943 (i.e. a :term:`path entry hook`) which knows how to locate modules given 944 a :term:`path entry`. 945 946 See :class:`importlib.abc.PathEntryFinder` for the methods that path entry 947 finders implement. 948 949 path entry hook 950 A callable on the :data:`sys.path_hook` list which returns a :term:`path 951 entry finder` if it knows how to find modules on a specific :term:`path 952 entry`. 953 954 path based finder 955 One of the default :term:`meta path finders <meta path finder>` which 956 searches an :term:`import path` for modules. 957 958 path-like object 959 An object representing a file system path. A path-like object is either 960 a :class:`str` or :class:`bytes` object representing a path, or an object 961 implementing the :class:`os.PathLike` protocol. An object that supports 962 the :class:`os.PathLike` protocol can be converted to a :class:`str` or 963 :class:`bytes` file system path by calling the :func:`os.fspath` function; 964 :func:`os.fsdecode` and :func:`os.fsencode` can be used to guarantee a 965 :class:`str` or :class:`bytes` result instead, respectively. Introduced 966 by :pep:`519`. 967 968 PEP 969 Python Enhancement Proposal. A PEP is a design document 970 providing information to the Python community, or describing a new 971 feature for Python or its processes or environment. PEPs should 972 provide a concise technical specification and a rationale for proposed 973 features. 974 975 PEPs are intended to be the primary mechanisms for proposing major new 976 features, for collecting community input on an issue, and for documenting 977 the design decisions that have gone into Python. The PEP author is 978 responsible for building consensus within the community and documenting 979 dissenting opinions. 980 981 See :pep:`1`. 982 983 portion 984 A set of files in a single directory (possibly stored in a zip file) 985 that contribute to a namespace package, as defined in :pep:`420`. 986 987 positional argument 988 See :term:`argument`. 989 990 provisional API 991 A provisional API is one which has been deliberately excluded from 992 the standard library's backwards compatibility guarantees. While major 993 changes to such interfaces are not expected, as long as they are marked 994 provisional, backwards incompatible changes (up to and including removal 995 of the interface) may occur if deemed necessary by core developers. Such 996 changes will not be made gratuitously -- they will occur only if serious 997 fundamental flaws are uncovered that were missed prior to the inclusion 998 of the API. 999 1000 Even for provisional APIs, backwards incompatible changes are seen as 1001 a "solution of last resort" - every attempt will still be made to find 1002 a backwards compatible resolution to any identified problems. 1003 1004 This process allows the standard library to continue to evolve over 1005 time, without locking in problematic design errors for extended periods 1006 of time. See :pep:`411` for more details. 1007 1008 provisional package 1009 See :term:`provisional API`. 1010 1011 Python 3000 1012 Nickname for the Python 3.x release line (coined long ago when the 1013 release of version 3 was something in the distant future.) This is also 1014 abbreviated "Py3k". 1015 1016 Pythonic 1017 An idea or piece of code which closely follows the most common idioms 1018 of the Python language, rather than implementing code using concepts 1019 common to other languages. For example, a common idiom in Python is 1020 to loop over all elements of an iterable using a :keyword:`for` 1021 statement. Many other languages don't have this type of construct, so 1022 people unfamiliar with Python sometimes use a numerical counter instead:: 1023 1024 for i in range(len(food)): 1025 print(food[i]) 1026 1027 As opposed to the cleaner, Pythonic method:: 1028 1029 for piece in food: 1030 print(piece) 1031 1032 qualified name 1033 A dotted name showing the "path" from a module's global scope to a 1034 class, function or method defined in that module, as defined in 1035 :pep:`3155`. For top-level functions and classes, the qualified name 1036 is the same as the object's name:: 1037 1038 >>> class C: 1039 ... class D: 1040 ... def meth(self): 1041 ... pass 1042 ... 1043 >>> C.__qualname__ 1044 'C' 1045 >>> C.D.__qualname__ 1046 'C.D' 1047 >>> C.D.meth.__qualname__ 1048 'C.D.meth' 1049 1050 When used to refer to modules, the *fully qualified name* means the 1051 entire dotted path to the module, including any parent packages, 1052 e.g. ``email.mime.text``:: 1053 1054 >>> import email.mime.text 1055 >>> email.mime.text.__name__ 1056 'email.mime.text' 1057 1058 reference count 1059 The number of references to an object. When the reference count of an 1060 object drops to zero, it is deallocated. Reference counting is 1061 generally not visible to Python code, but it is a key element of the 1062 :term:`CPython` implementation. The :mod:`sys` module defines a 1063 :func:`~sys.getrefcount` function that programmers can call to return the 1064 reference count for a particular object. 1065 1066 regular package 1067 A traditional :term:`package`, such as a directory containing an 1068 ``__init__.py`` file. 1069 1070 See also :term:`namespace package`. 1071 1072 __slots__ 1073 A declaration inside a class that saves memory by pre-declaring space for 1074 instance attributes and eliminating instance dictionaries. Though 1075 popular, the technique is somewhat tricky to get right and is best 1076 reserved for rare cases where there are large numbers of instances in a 1077 memory-critical application. 1078 1079 sequence 1080 An :term:`iterable` which supports efficient element access using integer 1081 indices via the :meth:`__getitem__` special method and defines a 1082 :meth:`__len__` method that returns the length of the sequence. 1083 Some built-in sequence types are :class:`list`, :class:`str`, 1084 :class:`tuple`, and :class:`bytes`. Note that :class:`dict` also 1085 supports :meth:`__getitem__` and :meth:`__len__`, but is considered a 1086 mapping rather than a sequence because the lookups use arbitrary 1087 :term:`immutable` keys rather than integers. 1088 1089 The :class:`collections.abc.Sequence` abstract base class 1090 defines a much richer interface that goes beyond just 1091 :meth:`__getitem__` and :meth:`__len__`, adding :meth:`count`, 1092 :meth:`index`, :meth:`__contains__`, and 1093 :meth:`__reversed__`. Types that implement this expanded 1094 interface can be registered explicitly using 1095 :func:`~abc.ABCMeta.register`. 1096 1097 set comprehension 1098 A compact way to process all or part of the elements in an iterable and 1099 return a set with the results. ``results = {c for c in 'abracadabra' if 1100 c not in 'abc'}`` generates the set of strings ``{'r', 'd'}``. See 1101 :ref:`comprehensions`. 1102 1103 single dispatch 1104 A form of :term:`generic function` dispatch where the implementation is 1105 chosen based on the type of a single argument. 1106 1107 slice 1108 An object usually containing a portion of a :term:`sequence`. A slice is 1109 created using the subscript notation, ``[]`` with colons between numbers 1110 when several are given, such as in ``variable_name[1:3:5]``. The bracket 1111 (subscript) notation uses :class:`slice` objects internally. 1112 1113 special method 1114 .. index:: pair: special; method 1115 1116 A method that is called implicitly by Python to execute a certain 1117 operation on a type, such as addition. Such methods have names starting 1118 and ending with double underscores. Special methods are documented in 1119 :ref:`specialnames`. 1120 1121 statement 1122 A statement is part of a suite (a "block" of code). A statement is either 1123 an :term:`expression` or one of several constructs with a keyword, such 1124 as :keyword:`if`, :keyword:`while` or :keyword:`for`. 1125 1126 strong reference 1127 In Python's C API, a strong reference is a reference to an object 1128 which increments the object's reference count when it is created and 1129 decrements the object's reference count when it is deleted. 1130 1131 The :c:func:`Py_NewRef` function can be used to create a strong reference 1132 to an object. Usually, the :c:func:`Py_DECREF` function must be called on 1133 the strong reference before exiting the scope of the strong reference, to 1134 avoid leaking one reference. 1135 1136 See also :term:`borrowed reference`. 1137 1138 text encoding 1139 A codec which encodes Unicode strings to bytes. 1140 1141 text file 1142 A :term:`file object` able to read and write :class:`str` objects. 1143 Often, a text file actually accesses a byte-oriented datastream 1144 and handles the :term:`text encoding` automatically. 1145 Examples of text files are files opened in text mode (``'r'`` or ``'w'``), 1146 :data:`sys.stdin`, :data:`sys.stdout`, and instances of 1147 :class:`io.StringIO`. 1148 1149 See also :term:`binary file` for a file object able to read and write 1150 :term:`bytes-like objects <bytes-like object>`. 1151 1152 triple-quoted string 1153 A string which is bound by three instances of either a quotation mark 1154 (") or an apostrophe ('). While they don't provide any functionality 1155 not available with single-quoted strings, they are useful for a number 1156 of reasons. They allow you to include unescaped single and double 1157 quotes within a string and they can span multiple lines without the 1158 use of the continuation character, making them especially useful when 1159 writing docstrings. 1160 1161 type 1162 The type of a Python object determines what kind of object it is; every 1163 object has a type. An object's type is accessible as its 1164 :attr:`~instance.__class__` attribute or can be retrieved with 1165 ``type(obj)``. 1166 1167 type alias 1168 A synonym for a type, created by assigning the type to an identifier. 1169 1170 Type aliases are useful for simplifying :term:`type hints <type hint>`. 1171 For example:: 1172 1173 def remove_gray_shades( 1174 colors: list[tuple[int, int, int]]) -> list[tuple[int, int, int]]: 1175 pass 1176 1177 could be made more readable like this:: 1178 1179 Color = tuple[int, int, int] 1180 1181 def remove_gray_shades(colors: list[Color]) -> list[Color]: 1182 pass 1183 1184 See :mod:`typing` and :pep:`484`, which describe this functionality. 1185 1186 type hint 1187 An :term:`annotation` that specifies the expected type for a variable, a class 1188 attribute, or a function parameter or return value. 1189 1190 Type hints are optional and are not enforced by Python but 1191 they are useful to static type analysis tools, and aid IDEs with code 1192 completion and refactoring. 1193 1194 Type hints of global variables, class attributes, and functions, 1195 but not local variables, can be accessed using 1196 :func:`typing.get_type_hints`. 1197 1198 See :mod:`typing` and :pep:`484`, which describe this functionality. 1199 1200 universal newlines 1201 A manner of interpreting text streams in which all of the following are 1202 recognized as ending a line: the Unix end-of-line convention ``'\n'``, 1203 the Windows convention ``'\r\n'``, and the old Macintosh convention 1204 ``'\r'``. See :pep:`278` and :pep:`3116`, as well as 1205 :func:`bytes.splitlines` for an additional use. 1206 1207 variable annotation 1208 An :term:`annotation` of a variable or a class attribute. 1209 1210 When annotating a variable or a class attribute, assignment is optional:: 1211 1212 class C: 1213 field: 'annotation' 1214 1215 Variable annotations are usually used for 1216 :term:`type hints <type hint>`: for example this variable is expected to take 1217 :class:`int` values:: 1218 1219 count: int = 0 1220 1221 Variable annotation syntax is explained in section :ref:`annassign`. 1222 1223 See :term:`function annotation`, :pep:`484` 1224 and :pep:`526`, which describe this functionality. 1225 Also see :ref:`annotations-howto` 1226 for best practices on working with annotations. 1227 1228 virtual environment 1229 A cooperatively isolated runtime environment that allows Python users 1230 and applications to install and upgrade Python distribution packages 1231 without interfering with the behaviour of other Python applications 1232 running on the same system. 1233 1234 See also :mod:`venv`. 1235 1236 virtual machine 1237 A computer defined entirely in software. Python's virtual machine 1238 executes the :term:`bytecode` emitted by the bytecode compiler. 1239 1240 Zen of Python 1241 Listing of Python design principles and philosophies that are helpful in 1242 understanding and using the language. The listing can be found by typing 1243 "``import this``" at the interactive prompt. 1244