forked from AFPy/python-docs-fr
420 lines
13 KiB
Plaintext
420 lines
13 KiB
Plaintext
# Copyright (C) 2001-2018, Python Software Foundation
|
|
# For licence information, see README file.
|
|
#
|
|
msgid ""
|
|
msgstr ""
|
|
"Project-Id-Version: Python 3.6\n"
|
|
"Report-Msgid-Bugs-To: \n"
|
|
"POT-Creation-Date: 2018-06-28 15:29+0200\n"
|
|
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
|
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
|
"Language-Team: FRENCH <traductions@lists.afpy.org>\n"
|
|
"Language: fr\n"
|
|
"MIME-Version: 1.0\n"
|
|
"Content-Type: text/plain; charset=UTF-8\n"
|
|
"Content-Transfer-Encoding: 8bit\n"
|
|
|
|
#: ../Doc/library/types.rst:2
|
|
msgid ":mod:`types` --- Dynamic type creation and names for built-in types"
|
|
msgstr ""
|
|
|
|
#: ../Doc/library/types.rst:7
|
|
msgid "**Source code:** :source:`Lib/types.py`"
|
|
msgstr "**Code source :** :source:`Lib/types.py`"
|
|
|
|
#: ../Doc/library/types.rst:11
|
|
msgid ""
|
|
"This module defines utility function to assist in dynamic creation of new "
|
|
"types."
|
|
msgstr ""
|
|
|
|
#: ../Doc/library/types.rst:14
|
|
msgid ""
|
|
"It also defines names for some object types that are used by the standard "
|
|
"Python interpreter, but not exposed as builtins like :class:`int` or :class:"
|
|
"`str` are."
|
|
msgstr ""
|
|
|
|
#: ../Doc/library/types.rst:18
|
|
msgid ""
|
|
"Finally, it provides some additional type-related utility classes and "
|
|
"functions that are not fundamental enough to be builtins."
|
|
msgstr ""
|
|
|
|
#: ../Doc/library/types.rst:23
|
|
msgid "Dynamic Type Creation"
|
|
msgstr ""
|
|
|
|
#: ../Doc/library/types.rst:27
|
|
msgid "Creates a class object dynamically using the appropriate metaclass."
|
|
msgstr ""
|
|
|
|
#: ../Doc/library/types.rst:29
|
|
msgid ""
|
|
"The first three arguments are the components that make up a class definition "
|
|
"header: the class name, the base classes (in order), the keyword arguments "
|
|
"(such as ``metaclass``)."
|
|
msgstr ""
|
|
|
|
#: ../Doc/library/types.rst:33
|
|
msgid ""
|
|
"The *exec_body* argument is a callback that is used to populate the freshly "
|
|
"created class namespace. It should accept the class namespace as its sole "
|
|
"argument and update the namespace directly with the class contents. If no "
|
|
"callback is provided, it has the same effect as passing in ``lambda ns: ns``."
|
|
msgstr ""
|
|
|
|
#: ../Doc/library/types.rst:43
|
|
msgid "Calculates the appropriate metaclass and creates the class namespace."
|
|
msgstr ""
|
|
|
|
#: ../Doc/library/types.rst:45
|
|
msgid ""
|
|
"The arguments are the components that make up a class definition header: the "
|
|
"class name, the base classes (in order) and the keyword arguments (such as "
|
|
"``metaclass``)."
|
|
msgstr ""
|
|
|
|
#: ../Doc/library/types.rst:49
|
|
msgid "The return value is a 3-tuple: ``metaclass, namespace, kwds``"
|
|
msgstr ""
|
|
|
|
#: ../Doc/library/types.rst:51
|
|
msgid ""
|
|
"*metaclass* is the appropriate metaclass, *namespace* is the prepared class "
|
|
"namespace and *kwds* is an updated copy of the passed in *kwds* argument "
|
|
"with any ``'metaclass'`` entry removed. If no *kwds* argument is passed in, "
|
|
"this will be an empty dict."
|
|
msgstr ""
|
|
|
|
#: ../Doc/library/types.rst:60
|
|
msgid ""
|
|
"The default value for the ``namespace`` element of the returned tuple has "
|
|
"changed. Now an insertion-order-preserving mapping is used when the "
|
|
"metaclass does not have a ``__prepare__`` method."
|
|
msgstr ""
|
|
|
|
#: ../Doc/library/types.rst:67
|
|
msgid ":ref:`metaclasses`"
|
|
msgstr ""
|
|
|
|
#: ../Doc/library/types.rst:67
|
|
msgid "Full details of the class creation process supported by these functions"
|
|
msgstr ""
|
|
|
|
#: ../Doc/library/types.rst:69
|
|
msgid ":pep:`3115` - Metaclasses in Python 3000"
|
|
msgstr ":pep:`3115` - Méta-classes dans Python 3000"
|
|
|
|
#: ../Doc/library/types.rst:70
|
|
msgid "Introduced the ``__prepare__`` namespace hook"
|
|
msgstr ""
|
|
"introduction de la fonction automatique ``__prepare__`` de l'espace de noms"
|
|
|
|
#: ../Doc/library/types.rst:74
|
|
msgid "Resolve MRO entries dynamically as specified by :pep:`560`."
|
|
msgstr ""
|
|
|
|
#: ../Doc/library/types.rst:76
|
|
msgid ""
|
|
"This function looks for items in *bases* that are not instances of :class:"
|
|
"`type`, and returns a tuple where each such object that has an "
|
|
"``__mro_entries__`` method is replaced with an unpacked result of calling "
|
|
"this method. If a *bases* item is an instance of :class:`type`, or it "
|
|
"doesn't have an ``__mro_entries__`` method, then it is included in the "
|
|
"return tuple unchanged."
|
|
msgstr ""
|
|
|
|
#: ../Doc/library/types.rst:87
|
|
msgid ":pep:`560` - Core support for typing module and generic types"
|
|
msgstr ""
|
|
|
|
#: ../Doc/library/types.rst:91
|
|
msgid "Standard Interpreter Types"
|
|
msgstr ""
|
|
|
|
#: ../Doc/library/types.rst:93
|
|
msgid ""
|
|
"This module provides names for many of the types that are required to "
|
|
"implement a Python interpreter. It deliberately avoids including some of the "
|
|
"types that arise only incidentally during processing such as the "
|
|
"``listiterator`` type."
|
|
msgstr ""
|
|
|
|
#: ../Doc/library/types.rst:98
|
|
msgid ""
|
|
"Typical use of these names is for :func:`isinstance` or :func:`issubclass` "
|
|
"checks."
|
|
msgstr ""
|
|
|
|
#: ../Doc/library/types.rst:101
|
|
msgid "Standard names are defined for the following types:"
|
|
msgstr ""
|
|
|
|
#: ../Doc/library/types.rst:106
|
|
msgid ""
|
|
"The type of user-defined functions and functions created by :keyword:"
|
|
"`lambda` expressions."
|
|
msgstr ""
|
|
|
|
#: ../Doc/library/types.rst:112
|
|
msgid ""
|
|
"The type of :term:`generator`-iterator objects, created by generator "
|
|
"functions."
|
|
msgstr ""
|
|
|
|
#: ../Doc/library/types.rst:118
|
|
msgid ""
|
|
"The type of :term:`coroutine` objects, created by :keyword:`async def` "
|
|
"functions."
|
|
msgstr ""
|
|
|
|
#: ../Doc/library/types.rst:126
|
|
msgid ""
|
|
"The type of :term:`asynchronous generator`-iterator objects, created by "
|
|
"asynchronous generator functions."
|
|
msgstr ""
|
|
|
|
#: ../Doc/library/types.rst:136
|
|
msgid "The type for code objects such as returned by :func:`compile`."
|
|
msgstr ""
|
|
|
|
#: ../Doc/library/types.rst:141
|
|
msgid "The type of methods of user-defined class instances."
|
|
msgstr ""
|
|
|
|
#: ../Doc/library/types.rst:147
|
|
msgid ""
|
|
"The type of built-in functions like :func:`len` or :func:`sys.exit`, and "
|
|
"methods of built-in classes. (Here, the term \"built-in\" means \"written "
|
|
"in C\".)"
|
|
msgstr ""
|
|
|
|
#: ../Doc/library/types.rst:154
|
|
msgid ""
|
|
"The type of methods of some built-in data types and base classes such as :"
|
|
"meth:`object.__init__` or :meth:`object.__lt__`."
|
|
msgstr ""
|
|
|
|
#: ../Doc/library/types.rst:162
|
|
msgid ""
|
|
"The type of *bound* methods of some built-in data types and base classes. "
|
|
"For example it is the type of :code:`object().__str__`."
|
|
msgstr ""
|
|
|
|
#: ../Doc/library/types.rst:170
|
|
msgid ""
|
|
"The type of methods of some built-in data types such as :meth:`str.join`."
|
|
msgstr ""
|
|
|
|
#: ../Doc/library/types.rst:177
|
|
msgid ""
|
|
"The type of *unbound* class methods of some built-in data types such as "
|
|
"``dict.__dict__['fromkeys']``."
|
|
msgstr ""
|
|
|
|
#: ../Doc/library/types.rst:185
|
|
msgid ""
|
|
"The type of :term:`modules <module>`. Constructor takes the name of the "
|
|
"module to be created and optionally its :term:`docstring`."
|
|
msgstr ""
|
|
|
|
#: ../Doc/library/types.rst:189
|
|
msgid ""
|
|
"Use :func:`importlib.util.module_from_spec` to create a new module if you "
|
|
"wish to set the various import-controlled attributes."
|
|
msgstr ""
|
|
|
|
#: ../Doc/library/types.rst:194
|
|
msgid "The :term:`docstring` of the module. Defaults to ``None``."
|
|
msgstr ""
|
|
|
|
#: ../Doc/library/types.rst:198
|
|
msgid "The :term:`loader` which loaded the module. Defaults to ``None``."
|
|
msgstr ""
|
|
|
|
#: ../Doc/library/types.rst:200 ../Doc/library/types.rst:214
|
|
msgid "Defaults to ``None``. Previously the attribute was optional."
|
|
msgstr ""
|
|
|
|
#: ../Doc/library/types.rst:205
|
|
msgid "The name of the module."
|
|
msgstr ""
|
|
|
|
#: ../Doc/library/types.rst:209
|
|
msgid ""
|
|
"Which :term:`package` a module belongs to. If the module is top-level (i.e. "
|
|
"not a part of any specific package) then the attribute should be set to "
|
|
"``''``, else it should be set to the name of the package (which can be :attr:"
|
|
"`__name__` if the module is a package itself). Defaults to ``None``."
|
|
msgstr ""
|
|
|
|
#: ../Doc/library/types.rst:220
|
|
msgid "The type of traceback objects such as found in ``sys.exc_info()[2]``."
|
|
msgstr ""
|
|
|
|
#: ../Doc/library/types.rst:222
|
|
msgid ""
|
|
"See :ref:`the language reference <traceback-objects>` for details of the "
|
|
"available attributes and operations, and guidance on creating tracebacks "
|
|
"dynamically."
|
|
msgstr ""
|
|
|
|
#: ../Doc/library/types.rst:229
|
|
msgid ""
|
|
"The type of frame objects such as found in ``tb.tb_frame`` if ``tb`` is a "
|
|
"traceback object."
|
|
msgstr ""
|
|
|
|
#: ../Doc/library/types.rst:232
|
|
msgid ""
|
|
"See :ref:`the language reference <frame-objects>` for details of the "
|
|
"available attributes and operations."
|
|
msgstr ""
|
|
|
|
#: ../Doc/library/types.rst:238
|
|
msgid ""
|
|
"The type of objects defined in extension modules with ``PyGetSetDef``, such "
|
|
"as ``FrameType.f_locals`` or ``array.array.typecode``. This type is used as "
|
|
"descriptor for object attributes; it has the same purpose as the :class:"
|
|
"`property` type, but for classes defined in extension modules."
|
|
msgstr ""
|
|
|
|
#: ../Doc/library/types.rst:246
|
|
msgid ""
|
|
"The type of objects defined in extension modules with ``PyMemberDef``, such "
|
|
"as ``datetime.timedelta.days``. This type is used as descriptor for simple "
|
|
"C data members which use standard conversion functions; it has the same "
|
|
"purpose as the :class:`property` type, but for classes defined in extension "
|
|
"modules."
|
|
msgstr ""
|
|
|
|
#: ../Doc/library/types.rst:253
|
|
msgid ""
|
|
"In other implementations of Python, this type may be identical to "
|
|
"``GetSetDescriptorType``."
|
|
msgstr ""
|
|
|
|
#: ../Doc/library/types.rst:258
|
|
msgid ""
|
|
"Read-only proxy of a mapping. It provides a dynamic view on the mapping's "
|
|
"entries, which means that when the mapping changes, the view reflects these "
|
|
"changes."
|
|
msgstr ""
|
|
|
|
#: ../Doc/library/types.rst:266
|
|
msgid ""
|
|
"Return ``True`` if the underlying mapping has a key *key*, else ``False``."
|
|
msgstr ""
|
|
|
|
#: ../Doc/library/types.rst:271
|
|
msgid ""
|
|
"Return the item of the underlying mapping with key *key*. Raises a :exc:"
|
|
"`KeyError` if *key* is not in the underlying mapping."
|
|
msgstr ""
|
|
|
|
#: ../Doc/library/types.rst:276
|
|
msgid ""
|
|
"Return an iterator over the keys of the underlying mapping. This is a "
|
|
"shortcut for ``iter(proxy.keys())``."
|
|
msgstr ""
|
|
|
|
#: ../Doc/library/types.rst:281
|
|
msgid "Return the number of items in the underlying mapping."
|
|
msgstr ""
|
|
|
|
#: ../Doc/library/types.rst:285
|
|
msgid "Return a shallow copy of the underlying mapping."
|
|
msgstr ""
|
|
|
|
#: ../Doc/library/types.rst:289
|
|
msgid ""
|
|
"Return the value for *key* if *key* is in the underlying mapping, else "
|
|
"*default*. If *default* is not given, it defaults to ``None``, so that this "
|
|
"method never raises a :exc:`KeyError`."
|
|
msgstr ""
|
|
|
|
#: ../Doc/library/types.rst:295
|
|
msgid ""
|
|
"Return a new view of the underlying mapping's items (``(key, value)`` pairs)."
|
|
msgstr ""
|
|
|
|
#: ../Doc/library/types.rst:300
|
|
msgid "Return a new view of the underlying mapping's keys."
|
|
msgstr ""
|
|
|
|
#: ../Doc/library/types.rst:304
|
|
msgid "Return a new view of the underlying mapping's values."
|
|
msgstr ""
|
|
|
|
#: ../Doc/library/types.rst:308
|
|
msgid "Additional Utility Classes and Functions"
|
|
msgstr ""
|
|
|
|
#: ../Doc/library/types.rst:312
|
|
msgid ""
|
|
"A simple :class:`object` subclass that provides attribute access to its "
|
|
"namespace, as well as a meaningful repr."
|
|
msgstr ""
|
|
|
|
#: ../Doc/library/types.rst:315
|
|
msgid ""
|
|
"Unlike :class:`object`, with ``SimpleNamespace`` you can add and remove "
|
|
"attributes. If a ``SimpleNamespace`` object is initialized with keyword "
|
|
"arguments, those are directly added to the underlying namespace."
|
|
msgstr ""
|
|
|
|
#: ../Doc/library/types.rst:319
|
|
msgid "The type is roughly equivalent to the following code::"
|
|
msgstr ""
|
|
|
|
#: ../Doc/library/types.rst:333
|
|
msgid ""
|
|
"``SimpleNamespace`` may be useful as a replacement for ``class NS: pass``. "
|
|
"However, for a structured record type use :func:`~collections.namedtuple` "
|
|
"instead."
|
|
msgstr ""
|
|
|
|
#: ../Doc/library/types.rst:342
|
|
msgid "Route attribute access on a class to __getattr__."
|
|
msgstr ""
|
|
|
|
#: ../Doc/library/types.rst:344
|
|
msgid ""
|
|
"This is a descriptor, used to define attributes that act differently when "
|
|
"accessed through an instance and through a class. Instance access remains "
|
|
"normal, but access to an attribute through a class will be routed to the "
|
|
"class's __getattr__ method; this is done by raising AttributeError."
|
|
msgstr ""
|
|
|
|
#: ../Doc/library/types.rst:349
|
|
msgid ""
|
|
"This allows one to have properties active on an instance, and have virtual "
|
|
"attributes on the class with the same name (see Enum for an example)."
|
|
msgstr ""
|
|
|
|
#: ../Doc/library/types.rst:356
|
|
msgid "Coroutine Utility Functions"
|
|
msgstr ""
|
|
|
|
#: ../Doc/library/types.rst:360
|
|
msgid ""
|
|
"This function transforms a :term:`generator` function into a :term:"
|
|
"`coroutine function` which returns a generator-based coroutine. The "
|
|
"generator-based coroutine is still a :term:`generator iterator`, but is also "
|
|
"considered to be a :term:`coroutine` object and is :term:`awaitable`. "
|
|
"However, it may not necessarily implement the :meth:`__await__` method."
|
|
msgstr ""
|
|
|
|
#: ../Doc/library/types.rst:367
|
|
msgid "If *gen_func* is a generator function, it will be modified in-place."
|
|
msgstr ""
|
|
|
|
#: ../Doc/library/types.rst:369
|
|
msgid ""
|
|
"If *gen_func* is not a generator function, it will be wrapped. If it returns "
|
|
"an instance of :class:`collections.abc.Generator`, the instance will be "
|
|
"wrapped in an *awaitable* proxy object. All other types of objects will be "
|
|
"returned as is."
|
|
msgstr ""
|