Pelokalan
Python ID
id en
Masuk
Proyek
glossary.po Berkas proyek · python-docs-id-3.14 · Bahasa Indonesia
Modul PO Hanya lihat
Teks sumber — English
Terjemahan — Bahasa Indonesia
A label associated with a variable, a class attribute or a function parameter or return value, used by convention as a :term:`type hint`.
See also the :term:`parameter` glossary entry, the FAQ question on :ref:`the difference between arguments and parameters <faq-argument-vs-parameter>`, and :pep:`362`.
A series of statements which returns some value to a caller. It can also be passed zero or more :term:`arguments <argument>` which may be used in the execution of the body. See also :term:`parameter`, :term:`method`, and the :ref:`function` section.
An :term:`annotation` of a function parameter or return value.
A :term:`type` that can be parameterized; typically a :ref:`container class<sequence-types>` such as :class:`list` or :class:`dict`. Used for :term:`type hints <type hint>` and :term:`annotations <annotation>`.
An anonymous inline function consisting of a single :term:`expression` which is evaluated when the function is called. The syntax to create a lambda function is ``lambda [parameters]: expression``
parameter
parameter
A named entity in a :term:`function` (or method) definition that specifies an :term:`argument` (or in some cases, arguments) that the function can accept. There are five kinds of parameter:
:dfn:`positional-or-keyword`: specifies an argument that can be passed either :term:`positionally <argument>` or as a :term:`keyword argument <argument>`. This is the default kind of parameter, for example *foo* and *bar* in the following::
:dfn:`positional-only`: specifies an argument that can be supplied only by position. Positional-only parameters can be defined by including a ``/`` character in the parameter list of the function definition after them, for example *posonly1* and *posonly2* in the following::
:dfn:`keyword-only`: specifies an argument that can be supplied only by keyword. Keyword-only parameters can be defined by including a single var-positional parameter or bare ``*`` in the parameter list of the function definition before them, for example *kw_only1* and *kw_only2* in the following::
:dfn:`var-positional`: specifies that an arbitrary sequence of positional arguments can be provided (in addition to any positional arguments already accepted by other parameters). Such a parameter can be defined by prepending the parameter name with ``*``, for example *args* in the following::
:dfn:`var-keyword`: specifies that arbitrarily many keyword arguments can be provided (in addition to any keyword arguments already accepted by other parameters). Such a parameter can be defined by prepending the parameter name with ``**``, for example *kwargs* in the example above.
Parameters can specify both optional and required arguments, as well as default values for some optional arguments.
See also the :term:`argument` glossary entry, the FAQ question on :ref:`the difference between arguments and parameters <faq-argument-vs-parameter>`, the :class:`inspect.Parameter` class, the :ref:`function` section, and :pep:`362`.
An :term:`annotation` that specifies the expected type for a variable, a class attribute, or a function parameter or return value.