# Copyright (C) 2001-2018, Python Software Foundation # For licence information, see README file. # msgid "" msgstr "" "Project-Id-Version: Python 3\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-04-14 13:19+0200\n" "PO-Revision-Date: 2018-09-28 10:04+0200\n" "Last-Translator: FULL NAME \n" "Language-Team: FRENCH \n" "Language: fr\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" #: library/types.rst:2 msgid ":mod:`types` --- Dynamic type creation and names for built-in types" msgstr "" #: library/types.rst:7 msgid "**Source code:** :source:`Lib/types.py`" msgstr "**Code source :** :source:`Lib/types.py`" #: library/types.rst:11 msgid "" "This module defines utility functions to assist in dynamic creation of new " "types." msgstr "" #: 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 "" #: 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 "" #: library/types.rst:23 msgid "Dynamic Type Creation" msgstr "" #: library/types.rst:27 msgid "Creates a class object dynamically using the appropriate metaclass." msgstr "" #: 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 "" #: 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: " "None``." msgstr "" #: library/types.rst:43 msgid "Calculates the appropriate metaclass and creates the class namespace." msgstr "" #: 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 "" #: library/types.rst:49 msgid "The return value is a 3-tuple: ``metaclass, namespace, kwds``" msgstr "" #: 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 "" #: 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 "" #: library/types.rst:67 msgid ":ref:`metaclasses`" msgstr ":ref:`metaclasses`" #: library/types.rst:67 msgid "Full details of the class creation process supported by these functions" msgstr "" #: library/types.rst:69 msgid ":pep:`3115` - Metaclasses in Python 3000" msgstr ":pep:`3115` — Méta-classes dans Python 3000" #: library/types.rst:70 msgid "Introduced the ``__prepare__`` namespace hook" msgstr "" "introduction de la fonction automatique ``__prepare__`` de l'espace de " "nommage" #: library/types.rst:74 msgid "Resolve MRO entries dynamically as specified by :pep:`560`." msgstr "" #: 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 :meth:" "`~object.__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 :meth:`!__mro_entries__` method, then it is included in " "the return tuple unchanged." msgstr "" #: library/types.rst:87 msgid ":pep:`560` - Core support for typing module and generic types" msgstr "" ":pep:`560` — Gestion de base pour les types modules et les types génériques" #: library/types.rst:91 msgid "Standard Interpreter Types" msgstr "" #: 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 "" #: library/types.rst:98 msgid "" "Typical use of these names is for :func:`isinstance` or :func:`issubclass` " "checks." msgstr "" #: library/types.rst:102 msgid "" "If you instantiate any of these types, note that signatures may vary between " "Python versions." msgstr "" #: library/types.rst:104 msgid "Standard names are defined for the following types:" msgstr "" #: library/types.rst:108 msgid "The type of :data:`None`." msgstr "" #: library/types.rst:116 msgid "" "The type of user-defined functions and functions created by :keyword:" "`lambda` expressions." msgstr "" #: library/types.rst:4 msgid "" "Raises an :ref:`auditing event ` ``function.__new__`` with " "argument ``code``." msgstr "" #: library/types.rst:121 msgid "" "The audit event only occurs for direct instantiation of function objects, " "and is not raised for normal compilation." msgstr "" #: library/types.rst:127 msgid "" "The type of :term:`generator`-iterator objects, created by generator " "functions." msgstr "" #: library/types.rst:133 msgid "" "The type of :term:`coroutine` objects, created by :keyword:`async def` " "functions." msgstr "" #: library/types.rst:141 msgid "" "The type of :term:`asynchronous generator`-iterator objects, created by " "asynchronous generator functions." msgstr "" #: library/types.rst:151 msgid "The type for code objects such as returned by :func:`compile`." msgstr "" #: library/types.rst:5 msgid "" "Raises an :ref:`auditing event ` ``code.__new__`` with arguments " "``code``, ``filename``, ``name``, ``argcount``, ``posonlyargcount``, " "``kwonlyargcount``, ``nlocals``, ``stacksize``, ``flags``." msgstr "" #: library/types.rst:155 msgid "" "Note that the audited arguments may not match the names or positions " "required by the initializer. The audit event only occurs for direct " "instantiation of code objects, and is not raised for normal compilation." msgstr "" #: library/types.rst:161 msgid "" "Return a copy of the code object with new values for the specified fields." msgstr "" #: library/types.rst:167 msgid "" "The type for cell objects: such objects are used as containers for a " "function's free variables." msgstr "" #: library/types.rst:175 msgid "The type of methods of user-defined class instances." msgstr "" #: library/types.rst:181 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 "" #: library/types.rst:188 msgid "" "The type of methods of some built-in data types and base classes such as :" "meth:`object.__init__` or :meth:`object.__lt__`." msgstr "" #: library/types.rst:196 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 "" #: library/types.rst:204 msgid "The type of :data:`NotImplemented`." msgstr "" #: library/types.rst:211 msgid "" "The type of methods of some built-in data types such as :meth:`str.join`." msgstr "" #: library/types.rst:218 msgid "" "The type of *unbound* class methods of some built-in data types such as " "``dict.__dict__['fromkeys']``." msgstr "" #: library/types.rst:226 msgid "" "The type of :term:`modules `. The constructor takes the name of the " "module to be created and optionally its :term:`docstring`." msgstr "" #: library/types.rst:230 msgid "" "Use :func:`importlib.util.module_from_spec` to create a new module if you " "wish to set the various import-controlled attributes." msgstr "" #: library/types.rst:235 msgid "The :term:`docstring` of the module. Defaults to ``None``." msgstr "" #: library/types.rst:239 msgid "The :term:`loader` which loaded the module. Defaults to ``None``." msgstr "" #: library/types.rst:241 msgid "" "This attribute is to match :attr:`importlib.machinery.ModuleSpec.loader` as " "stored in the :attr:`__spec__` object." msgstr "" #: library/types.rst:245 msgid "" "A future version of Python may stop setting this attribute by default. To " "guard against this potential change, preferably read from the :attr:" "`__spec__` attribute instead or use ``getattr(module, \"__loader__\", " "None)`` if you explicitly need to use this attribute." msgstr "" #: library/types.rst:276 msgid "Defaults to ``None``. Previously the attribute was optional." msgstr "" #: library/types.rst:256 msgid "" "The name of the module. Expected to match :attr:`importlib.machinery." "ModuleSpec.name`." msgstr "" #: library/types.rst:261 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 "" #: library/types.rst:266 msgid "" "This attribute is to match :attr:`importlib.machinery.ModuleSpec.parent` as " "stored in the :attr:`__spec__` object." msgstr "" #: library/types.rst:270 msgid "" "A future version of Python may stop setting this attribute by default. To " "guard against this potential change, preferably read from the :attr:" "`__spec__` attribute instead or use ``getattr(module, \"__package__\", " "None)`` if you explicitly need to use this attribute." msgstr "" #: library/types.rst:281 msgid "" "A record of the module's import-system-related state. Expected to be an " "instance of :class:`importlib.machinery.ModuleSpec`." msgstr "" #: library/types.rst:289 msgid "The type of :data:`Ellipsis`." msgstr "" #: library/types.rst:295 msgid "" "The type of :ref:`parameterized generics ` such as " "``list[int]``." msgstr "" #: library/types.rst:298 msgid "" "``t_origin`` should be a non-parameterized generic class, such as ``list``, " "``tuple`` or ``dict``. ``t_args`` should be a :class:`tuple` (possibly of " "length 1) of types which parameterize ``t_origin``::" msgstr "" #: library/types.rst:311 msgid "This type can now be subclassed." msgstr "" #: library/types.rst:317 msgid "The type of :ref:`union type expressions`." msgstr "" #: library/types.rst:323 msgid "" "The type of traceback objects such as found in ``sys.exception()." "__traceback__``." msgstr "" #: library/types.rst:325 msgid "" "See :ref:`the language reference ` for details of the " "available attributes and operations, and guidance on creating tracebacks " "dynamically." msgstr "" #: library/types.rst:332 msgid "" "The type of frame objects such as found in ``tb.tb_frame`` if ``tb`` is a " "traceback object." msgstr "" #: library/types.rst:335 msgid "" "See :ref:`the language reference ` for details of the " "available attributes and operations." msgstr "" #: library/types.rst:341 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 "" #: library/types.rst:349 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 "" #: library/types.rst:356 msgid "" "In other implementations of Python, this type may be identical to " "``GetSetDescriptorType``." msgstr "" #: library/types.rst:361 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 "" #: library/types.rst:369 msgid "" "Updated to support the new union (``|``) operator from :pep:`584`, which " "simply delegates to the underlying mapping." msgstr "" #: library/types.rst:374 msgid "" "Return ``True`` if the underlying mapping has a key *key*, else ``False``." msgstr "" #: library/types.rst:379 msgid "" "Return the item of the underlying mapping with key *key*. Raises a :exc:" "`KeyError` if *key* is not in the underlying mapping." msgstr "" #: library/types.rst:384 msgid "" "Return an iterator over the keys of the underlying mapping. This is a " "shortcut for ``iter(proxy.keys())``." msgstr "" #: library/types.rst:389 msgid "Return the number of items in the underlying mapping." msgstr "" #: library/types.rst:393 msgid "Return a shallow copy of the underlying mapping." msgstr "" #: library/types.rst:397 #, fuzzy 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 "" "Renvoie la valeur de *key* si *key* est dans le dictionnaire, sinon " "*default*. Si *default* n'est pas donné, il vaut ``None`` par défaut, de " "manière à ce que cette méthode ne lève jamais :exc:`KeyError`." #: library/types.rst:403 msgid "" "Return a new view of the underlying mapping's items (``(key, value)`` pairs)." msgstr "" #: library/types.rst:408 msgid "Return a new view of the underlying mapping's keys." msgstr "" #: library/types.rst:412 msgid "Return a new view of the underlying mapping's values." msgstr "" #: library/types.rst:416 msgid "Return a reverse iterator over the keys of the underlying mapping." msgstr "" #: library/types.rst:422 msgid "Additional Utility Classes and Functions" msgstr "" #: library/types.rst:426 msgid "" "A simple :class:`object` subclass that provides attribute access to its " "namespace, as well as a meaningful repr." msgstr "" #: library/types.rst:429 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 "" #: library/types.rst:433 msgid "The type is roughly equivalent to the following code::" msgstr "" #: library/types.rst:448 msgid "" "``SimpleNamespace`` may be useful as a replacement for ``class NS: pass``. " "However, for a structured record type use :func:`~collections.namedtuple` " "instead." msgstr "" #: library/types.rst:454 msgid "" "Attribute order in the repr changed from alphabetical to insertion (like " "``dict``)." msgstr "" #: library/types.rst:460 msgid "Route attribute access on a class to __getattr__." msgstr "" #: library/types.rst:462 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 "" #: library/types.rst:467 msgid "" "This allows one to have properties active on an instance, and have virtual " "attributes on the class with the same name (see :class:`enum.Enum` for an " "example)." msgstr "" #: library/types.rst:474 msgid "Coroutine Utility Functions" msgstr "" #: library/types.rst:478 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:`~object.__await__` " "method." msgstr "" #: library/types.rst:485 msgid "If *gen_func* is a generator function, it will be modified in-place." msgstr "" #: library/types.rst:487 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 ""