Teks sumber — English
Terjemahan — Bahasa Indonesia
See also :func:`format` for more information.
Lihat juga :func:`format` untuk informasi lebih lanjut.
Class methods are different than C++ or Java static methods. If you want those, see :func:`staticmethod` in this section. For more information on class methods, see :ref:`types`.
The *mode* argument specifies what kind of code must be compiled; it can be ``'exec'`` if *source* consists of a sequence of statements, ``'eval'`` if it consists of a single expression, or ``'single'`` if it consists of a single interactive statement (in the latter case, expression statements that evaluate to something other than ``None`` will be printed). It can also be ``'func_type'`` if *source* consists of a function type signature, for example ``(int) -> str``; see :func:`ast.parse` for more information. This mode requires passing :data:`ast.PyCF_ONLY_AST` in *flags*.
Return a "memory view" object created from the given argument. See :ref:`typememoryview` for more information.
Kembalikan objek "memory view" yang dibuat dari argumen yang diberikan. Lihat :ref:`typememoryview` untuk informasi lebih lanjut.
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.
For more information on static methods, see :ref:`types`.
Untuk informasi lebih lanjut tentang metode statis, lihat :ref:`types`.