# 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: 2020-02-04 10:00+0100\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" #: ../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 functions 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 " "nommage" #: ../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 "" ":pep:`560` -- Gestion de base pour les types modules et les types génériques" #: ../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:102 msgid "" "If you instantiate any of these types, note that signatures may vary between " "Python versions." msgstr "" #: ../Doc/library/types.rst:104 msgid "Standard names are defined for the following types:" msgstr "" #: ../Doc/library/types.rst:109 msgid "" "The type of user-defined functions and functions created by :keyword:" "`lambda` expressions." msgstr "" #: ../Doc/library/types.rst:115 msgid "" "The type of :term:`generator`-iterator objects, created by generator " "functions." msgstr "" #: ../Doc/library/types.rst:121 msgid "" "The type of :term:`coroutine` objects, created by :keyword:`async def` " "functions." msgstr "" #: ../Doc/library/types.rst:129 msgid "" "The type of :term:`asynchronous generator`-iterator objects, created by " "asynchronous generator functions." msgstr "" #: ../Doc/library/types.rst:139 msgid "The type for code objects such as returned by :func:`compile`." msgstr "" #: ../Doc/library/types.rst:142 msgid "" "Raises an :ref:`auditing event ` ``code.__new__`` with arguments " "``code``, ``filename``, ``name``, ``argcount``, ``posonlyargcount``, " "``kwonlyargcount``, ``nlocals``, ``stacksize``, ``flags``." msgstr "" #: ../Doc/library/types.rst:143 msgid "" "Note that the audited arguments may not match the names or positions " "required by the initializer." msgstr "" #: ../Doc/library/types.rst:148 msgid "" "Return a copy of the code object with new values for the specified fields." msgstr "" #: ../Doc/library/types.rst:154 msgid "" "The type for cell objects: such objects are used as containers for a " "function's free variables." msgstr "" #: ../Doc/library/types.rst:162 msgid "The type of methods of user-defined class instances." msgstr "" #: ../Doc/library/types.rst:168 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:175 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:183 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:191 msgid "" "The type of methods of some built-in data types such as :meth:`str.join`." msgstr "" #: ../Doc/library/types.rst:198 msgid "" "The type of *unbound* class methods of some built-in data types such as " "``dict.__dict__['fromkeys']``." msgstr "" #: ../Doc/library/types.rst:206 msgid "" "The type of :term:`modules `. Constructor takes the name of the " "module to be created and optionally its :term:`docstring`." msgstr "" #: ../Doc/library/types.rst:210 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:215 msgid "The :term:`docstring` of the module. Defaults to ``None``." msgstr "" #: ../Doc/library/types.rst:219 msgid "The :term:`loader` which loaded the module. Defaults to ``None``." msgstr "" #: ../Doc/library/types.rst:221 ../Doc/library/types.rst:235 msgid "Defaults to ``None``. Previously the attribute was optional." msgstr "" #: ../Doc/library/types.rst:226 msgid "The name of the module." msgstr "" #: ../Doc/library/types.rst:230 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:241 msgid "The type of traceback objects such as found in ``sys.exc_info()[2]``." msgstr "" #: ../Doc/library/types.rst:243 msgid "" "See :ref:`the language reference ` for details of the " "available attributes and operations, and guidance on creating tracebacks " "dynamically." msgstr "" #: ../Doc/library/types.rst:250 msgid "" "The type of frame objects such as found in ``tb.tb_frame`` if ``tb`` is a " "traceback object." msgstr "" #: ../Doc/library/types.rst:253 msgid "" "See :ref:`the language reference ` for details of the " "available attributes and operations." msgstr "" #: ../Doc/library/types.rst:259 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:267 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:274 msgid "" "In other implementations of Python, this type may be identical to " "``GetSetDescriptorType``." msgstr "" #: ../Doc/library/types.rst:279 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:287 msgid "" "Return ``True`` if the underlying mapping has a key *key*, else ``False``." msgstr "" #: ../Doc/library/types.rst:292 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:297 msgid "" "Return an iterator over the keys of the underlying mapping. This is a " "shortcut for ``iter(proxy.keys())``." msgstr "" #: ../Doc/library/types.rst:302 msgid "Return the number of items in the underlying mapping." msgstr "" #: ../Doc/library/types.rst:306 msgid "Return a shallow copy of the underlying mapping." msgstr "" #: ../Doc/library/types.rst:310 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:316 msgid "" "Return a new view of the underlying mapping's items (``(key, value)`` pairs)." msgstr "" #: ../Doc/library/types.rst:321 msgid "Return a new view of the underlying mapping's keys." msgstr "" #: ../Doc/library/types.rst:325 msgid "Return a new view of the underlying mapping's values." msgstr "" #: ../Doc/library/types.rst:329 msgid "Additional Utility Classes and Functions" msgstr "" #: ../Doc/library/types.rst:333 msgid "" "A simple :class:`object` subclass that provides attribute access to its " "namespace, as well as a meaningful repr." msgstr "" #: ../Doc/library/types.rst:336 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:340 msgid "The type is roughly equivalent to the following code::" msgstr "" #: ../Doc/library/types.rst:354 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:363 msgid "Route attribute access on a class to __getattr__." msgstr "" #: ../Doc/library/types.rst:365 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:370 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:377 msgid "Coroutine Utility Functions" msgstr "" #: ../Doc/library/types.rst:381 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:388 msgid "If *gen_func* is a generator function, it will be modified in-place." msgstr "" #: ../Doc/library/types.rst:390 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 ""