|
Original |
Translation |
|
11
|
Python source code is compiled into bytecode, the internal representation of a Python program in the interpreter. The bytecode is also cached in ``.pyc`` and ``.pyo`` files so that executing the same file is faster the second time (recompilation from source to bytecode can be avoided). This "intermediate language" is said to run on a :term:`virtual machine` that executes the machine code corresponding to each bytecode.
|
Le code source Python est compilé en bytecode, la représentation interne d'un programme Python dans l'interpréteur. Le bytecode est également mis en cache dans les fichiers ``.pyc`` et ``.pyo`` de sorte que l'exécution du même fichier est plus rapide la seconde fois (la recompilation de la source en bytecode peut être évitée). Ce "langage intermédiaire" est exécuté dans un interpréteur appelé "machine virtuelle" qui exécute le code machine de chaque bytecode correspondant.
|
|
12
|
A template for creating user-defined objects. Class definitions normally contain method definitions which operate on instances of the class.
|
Un modèle pour créer des objets définis par l'utilisateur. Les définitions de classes contiennent normalement des définitions de méthodes qui agissent sur les instances de classe.
|
|
13
|
The implicit conversion of an instance of one type to another during an operation which involves two arguments of the same type. For example, ``int(3.15)`` converts the floating point number to the integer ``3``, but in ``3+4.5``, each argument is of a different type (one int, one float), and both must be converted to the same type before they can be added or it will raise a ``TypeError``. Without coercion, all arguments of even compatible types would have to be normalized to the same value by the programmer, e.g., ``float(3)+4.5`` rather than just ``3+4.5``.
|
|
|
14
|
An extension of the familiar real number system in which all numbers are expressed as a sum of a real part and an imaginary part. Imaginary numbers are real multiples of the imaginary unit (the square root of ``-1``), often written ``i`` in mathematics or ``j`` in engineering. Python has built-in support for complex numbers, which are written with this latter notation; the imaginary part is written with a ``j`` suffix, e.g., ``3+1j``. To get access to complex equivalents of the :mod:`math` module, use :mod:`cmath`. Use of complex numbers is a fairly advanced mathematical feature. If you're not aware of a need for them, it's almost certain you can safely ignore them.
|
Une extension du système numéral réel familier dans laquelle tous les nombres sont exprimés sous la forme d'une somme d'un réel et d'un imaginaire. Les nombres imaginaures sont de réels multiples d'une unité imaginaire (la racine carrée de ``-1``), souvent écrite ``i`` en mathématiques ou ``j`` en ingénierie. Python supporte nativement les nombres complexes, écrits avec cette dernière notation; la partie imaginaire est écrite avec un suffixe ``j``, exemple, ``3+1j``. Pour utiliser les équivalents complexes à :mod:`math`, utilisez :mod:`cmath`. L'utilisation des nombres complexes est une caractéristiques des mathématiques avancées. Si vous n'en avez pas l'utilité, vous pouvez les ignorer en toute tranquilité.
|
|
15
|
An object which controls the environment seen in a :keyword:`with` statement by defining :meth:`__enter__` and :meth:`__exit__` methods. See :pep:`343`.
|
|
|
16
|
|
17
|
A function returning another function, usually applied as a function transformation using the ``@wrapper`` syntax. Common examples for decorators are :func:`classmethod` and :func:`staticmethod`.
|
Une fonction retournant une autre fonction, utilisé habituellement dans une transformation de fonction via la syntaxe ``@wrapper``.Les exemples habituels pour les décorateurs sont :func:`classmethod` et :func:`staticmethod`.
|
|
18
|
The decorator syntax is merely syntactic sugar, the following two function definitions are semantically equivalent::
|
La syntaxe decorator est simplement du sucre syntaxique, les définitions des deux fonctions suivantes sont sémantiquement équivalentes :
|
|
19
|
def f(...): ... f = staticmethod(f) @staticmethod def f(...): ...
|
def f(...): ... f = staticmethod(f) @staticmethod def f(...): ...
|
|
20
|
The same concept exists for classes, but is less commonly used there. See the documentation for :ref:`function definitions <function>` and :ref:`class definitions <class>` for more about decorators.
|
Quoique moins fréquemment utilisé, le même concept existe pour les classes. Consultez la documentation :ref:`définitions de fonctions <function> et :ref:`définitions de classes <class>` pour en savoir plus sur les decorators.
|