The text below is selected, press Ctrl+C to copy to your clipboard. (⌘+C on Mac) No line numbers will be copied.
Guest
Python Glossary: terms starting with letter P
By Guest on 13th November 2022 09:29:04 PM | Syntax: PYTHON | Views: 213



New Paste New paste | Download Paste Download | Toggle Line Numbers Show/Hide line no. | Copy Paste Copy text to clipboard
  1. Glossary - P
  2. ********
  3.  
  4. package
  5.    A Python *module* which can contain submodules or recursively,
  6.    subpackages.  Technically, a package is a Python module with an
  7.    "__path__" attribute.
  8.  
  9.    See also *regular package* and *namespace package*.
  10.  
  11. parameter
  12.    A named entity in a *function* (or method) definition that
  13.    specifies an *argument* (or in some cases, arguments) that the
  14.    function can accept.  There are five kinds of parameter:
  15.  
  16.    * *positional-or-keyword*: specifies an argument that can be passed
  17.      either *positionally* or as a *keyword argument*.  This is the
  18.      default kind of parameter, for example *foo* and *bar* in the
  19.      following:
  20.  
  21.         def func(foo, bar=None): ...
  22.  
  23.    * *positional-only*: specifies an argument that can be supplied
  24.      only by position. Positional-only parameters can be defined by
  25.      including a "/" character in the parameter list of the function
  26.      definition after them, for example *posonly1* and *posonly2* in
  27.      the following:
  28.  
  29.         def func(posonly1, posonly2, /, positional_or_keyword): ...
  30.  
  31.    * *keyword-only*: specifies an argument that can be supplied only
  32.      by keyword.  Keyword-only parameters can be defined by including
  33.      a single var-positional parameter or bare "*" in the parameter
  34.      list of the function definition before them, for example
  35.      *kw_only1* and *kw_only2* in the following:
  36.  
  37.         def func(arg, *, kw_only1, kw_only2): ...
  38.  
  39.    * *var-positional*: specifies that an arbitrary sequence of
  40.      positional arguments can be provided (in addition to any
  41.      positional arguments already accepted by other parameters).  Such
  42.      a parameter can be defined by prepending the parameter name with
  43.      "*", for example *args* in the following:
  44.  
  45.         def func(*args, **kwargs): ...
  46.  
  47.    * *var-keyword*: specifies that arbitrarily many keyword arguments
  48.      can be provided (in addition to any keyword arguments already
  49.      accepted by other parameters).  Such a parameter can be defined
  50.      by prepending the parameter name with "**", for example *kwargs*
  51.      in the example above.
  52.  
  53.    Parameters can specify both optional and required arguments, as
  54.    well as default values for some optional arguments.
  55.  
  56.    See also the *argument* glossary entry, the FAQ question on the
  57.    difference between arguments and parameters, the
  58.    "inspect.Parameter" class, the Function definitions section, and
  59.    **PEP 362**.
  60.  
  61. path entry
  62.    A single location on the *import path* which the *path based
  63.    finder* consults to find modules for importing.
  64.  
  65. path entry finder
  66.    A *finder* returned by a callable on "sys.path_hooks" (i.e. a *path
  67.    entry hook*) which knows how to locate modules given a *path
  68.    entry*.
  69.  
  70.    See "importlib.abc.PathEntryFinder" for the methods that path entry
  71.    finders implement.
  72.  
  73. path entry hook
  74.    A callable on the "sys.path_hook" list which returns a *path entry
  75.    finder* if it knows how to find modules on a specific *path entry*.
  76.  
  77. path based finder
  78.    One of the default *meta path finders* which searches an *import
  79.    path* for modules.
  80.  
  81. path-like object
  82.    An object representing a file system path. A path-like object is
  83.    either a "str" or "bytes" object representing a path, or an object
  84.    implementing the "os.PathLike" protocol. An object that supports
  85.    the "os.PathLike" protocol can be converted to a "str" or "bytes"
  86.    file system path by calling the "os.fspath()" function;
  87.    "os.fsdecode()" and "os.fsencode()" can be used to guarantee a
  88.    "str" or "bytes" result instead, respectively. Introduced by **PEP
  89.    519**.
  90.  
  91. PEP
  92.    Python Enhancement Proposal. A PEP is a design document providing
  93.    information to the Python community, or describing a new feature
  94.    for Python or its processes or environment. PEPs should provide a
  95.    concise technical specification and a rationale for proposed
  96.    features.
  97.  
  98.    PEPs are intended to be the primary mechanisms for proposing major
  99.    new features, for collecting community input on an issue, and for
  100.    documenting the design decisions that have gone into Python. The
  101.    PEP author is responsible for building consensus within the
  102.    community and documenting dissenting opinions.
  103.  
  104.    See **PEP 1**.
  105.  
  106. portion
  107.    A set of files in a single directory (possibly stored in a zip
  108.    file) that contribute to a namespace package, as defined in **PEP
  109.    420**.
  110.  
  111. positional argument
  112.    See *argument*.
  113.  
  114. provisional API
  115.    A provisional API is one which has been deliberately excluded from
  116.    the standard library's backwards compatibility guarantees.  While
  117.   major changes to such interfaces are not expected, as long as they
  118.   are marked provisional, backwards incompatible changes (up to and
  119.   including removal of the interface) may occur if deemed necessary
  120.   by core developers.  Such changes will not be made gratuitously --
  121.   they will occur only if serious fundamental flaws are uncovered
  122.   that were missed prior to the inclusion of the API.
  123.  
  124.   Even for provisional APIs, backwards incompatible changes are seen
  125.   as a "solution of last resort" - every attempt will still be made
  126.   to find a backwards compatible resolution to any identified
  127.   problems.
  128.  
  129.   This process allows the standard library to continue to evolve over
  130.   time, without locking in problematic design errors for extended
  131.   periods of time.  See **PEP 411** for more details.
  132.  
  133. provisional package
  134.   See *provisional API*.
  135.  
  136. Python 3000
  137.   Nickname for the Python 3.x release line (coined long ago when the
  138.   release of version 3 was something in the distant future.)  This is
  139.   also abbreviated "Py3k".
  140.  
  141. Pythonic
  142.   An idea or piece of code which closely follows the most common
  143.   idioms of the Python language, rather than implementing code using
  144.   concepts common to other languages.  For example, a common idiom in
  145.   Python is to loop over all elements of an iterable using a "for"
  146.   statement.  Many other languages don't have this type of construct,
  147.    so people unfamiliar with Python sometimes use a numerical counter
  148.    instead:
  149.  
  150.       for i in range(len(food)):
  151.           print(food[i])
  152.  
  153.    As opposed to the cleaner, Pythonic method:
  154.  
  155.       for piece in food:
  156.           print(piece)
















Python software and documentation are licensed under the PSF License Agreement.
Starting with Python 3.8.6, examples, recipes, and other code in the documentation are dual licensed under the PSF License Agreement and the Zero-Clause BSD license.
Some software incorporated into Python is under different licenses. The licenses are listed with code falling under that license. See Licenses and Acknowledgements for Incorporated Software for an incomplete list of these licenses.

Python and it's documentation is:
Copyright © 2001-2022 Python Software Foundation. All rights reserved.
Copyright © 2000 BeOpen.com. All rights reserved.
Copyright © 1995-2000 Corporation for National Research Initiatives. All rights reserved.
Copyright © 1991-1995 Stichting Mathematisch Centrum. All rights reserved.

See History and License for complete license and permissions information:
https://docs.python.org/3/license.html#psf-license
  • Recent Pastes