Teks sumber — English
Terjemahan — Bahasa Indonesia
:exc:`SyntaxError` is raised instead of :exc:`ValueError` when null bytes are encountered in *source*.
This function can also be used to execute arbitrary code objects (such as those created by :func:`compile`). In this case, pass a code object instead of a string. If the code object has been compiled with ``'exec'`` as the *mode* argument, :func:`eval`\'s return value will be ``None``.
If *base* is not an instance of :class:`int` and the *base* object has a :meth:`base.__index__ <object.__index__>` method, that method is called to obtain an integer for the base. Previous versions used :meth:`base.__int__ <object.__int__>` instead of :meth:`base.__index__ <object.__index__>`.
Jika *base* bukan turunan dari :class:`int` dan objek *base* memiliki metode :meth:`base.__index__ <object.__index__>`, metode itu dipanggil untuk mendapatkan integer untuk basis. Versi sebelumnya menggunakan <object.__int__>` alih-alih :meth: `base.__index__ <object.__index__>`.
In an :term:`optimized scope` (including functions, generators, and coroutines), each call to ``locals()`` instead returns a fresh dictionary containing the current bindings of the function's local variables and any nonlocal cell references. In this case, name binding changes made via the returned dict are *not* written back to the corresponding local variables or nonlocal cell references, and assigning, reassigning, or deleting local variables and nonlocal cell references does *not* affect the contents of previously returned dictionaries.
If the system call is interrupted and the signal handler does not raise an exception, the function now retries the system call instead of raising an :exc:`InterruptedError` exception (see :pep:`475` for the rationale).
Jika panggilan sistem terganggu dan penangan sinyal tidak menimbulkan pengecualian, fungsi sekarang mencoba ulang panggilan sistem alih-alih menimbulkan pengecualian :exc:`InterruptedError` (lihat :pep:`475` untuk penjelasannya).
UTF-8 is now the default encoding, instead of the platform-dependent locale encoding (:pep:`686`).
The *file* argument must be an object with a ``write(string)`` method; if it is not present or ``None``, :data:`sys.stdout` will be used. Since printed arguments are converted to text strings, :func:`print` cannot be used with binary mode file objects. For these, use ``file.write(...)`` instead.
Argumen *file* harus berupa objek dengan metode ``write(string)``; jika tidak ada atau ``None``, :data:`sys.stdout` akan digunakan. Karena argumen yang dicetak dikonversi ke string teks, :func:`print` tidak dapat digunakan dengan objek file mode biner. Untuk ini, gunakan ``file.write(...)`` sebagai gantinya.
The behavior of :func:`round` for floats can be surprising: for example, ``round(2.675, 2)`` gives ``2.67`` instead of the expected ``2.68``. This is not a bug: it's a result of the fact that most decimal fractions can't be represented exactly as a float. See :ref:`tut-fp-issues` for more information.
Perilaku :func:`round` untuk pecahan *floats* bisa mengejutkan: misalnya, ``round(2.675, 2)`` memberikan ``2.67`` alih-alih yang diharapkan ``2.68``. Ini bukan bug: ini adalah hasil dari fakta bahwa sebagian besar pecahan desimal tidak dapat diwakili persis seperti pelampung *float*. Lihat :ref:`tut-fp-issues` untuk informasi lebih lanjut.