Teks sumber — English
Terjemahan — Bahasa Indonesia
Like ``s*``, except that it provides a :ref:`borrowed buffer <c-arg-borrowed-buffer>`. The result is stored into two C variables, the first one a pointer to a C string, the second one its length. The string may contain embedded null bytes. Unicode objects are converted to C strings using ``'utf-8'`` encoding.
Seperti ``s*``, kecuali bahwa ia menyediakan buffer :ref:`pinjaman <c-arg-borrowed-buffer>`. Hasilnya disimpan ke dalam dua variabel C, yang pertama adalah penunjuk ke sebuah string C, yang kedua adalah panjangnya. String tersebut dapat berisi byte null yang disematkan. Objek Unicode dikonversi ke string C menggunakan pengkodean ``'utf-8'``.
``es#`` (:class:`str`) [const char \*encoding, char \*\*buffer, :c:type:`Py_ssize_t` \*buffer_length]
``es#`` (:class:`str`) [const char \*encoding, char \*\*buffer, :c:type:`Py_ssize_t` \*buffer_length]
If *\*buffer* points to a non-``NULL`` pointer (an already allocated buffer), :c:func:`PyArg_ParseTuple` will use this location as the buffer and interpret the initial value of *\*buffer_length* as the buffer size. It will then copy the encoded data into the buffer and NUL-terminate it. If the buffer is not large enough, a :exc:`ValueError` will be set.
In both cases, *\*buffer_length* is set to the length of the encoded data without the trailing NUL byte.
W obu przypadkach, *\*buffer_length* jest ustawiany na długość zakodowanych danych z pominięciem zakańczającego znaku NUL.
``et#`` (:class:`str`, :class:`bytes` or :class:`bytearray`) [const char \*encoding, char \*\*buffer, :c:type:`Py_ssize_t` \*buffer_length]
``et#`` (:class:`str`, :class:`bytes` atau :class:`bytearray`) [const char \*encoding, char \*\*buffer, :c:type:`Py_ssize_t` \*buffer_length]
``c`` (:class:`bytes` or :class:`bytearray` of length 1) [char]
``c`` (:class:`bytes` atau :class:`bytearray` dengan panjang 1) [char]
Convert a Python byte, represented as a :class:`bytes` or :class:`bytearray` object of length 1, to a C :c:expr:`char`.
Mengonversi byte Python, direpresentasikan sebagai objek :class:`bytes` atau :class:`bytearray` dengan panjang 1, ke C :c:expr:`char`.
``C`` (:class:`str` of length 1) [int]
``C`` (:class:`str` dengan panjang 1) [int]
Convert a Python character, represented as a :class:`str` object of length 1, to a C :c:expr:`int`.
Mengonversi karakter Python, direpresentasikan sebagai objek :class:`str` dengan panjang 1, menjadi C :c:expr:`int`.
The object must be a Python sequence (except :class:`str`, :class:`bytes` or :class:`bytearray`) whose length is the number of format units in *items*. The C arguments must correspond to the individual format units in *items*. Format units for sequences may be nested.
Objek harus berupa urutan Python (kecuali :class:`str`, :class:`bytes` atau :class:`bytearray`) yang panjangnya adalah jumlah unit format dalam *items*. Argumen C harus sesuai dengan unit format individual dalam *items*. Unit format untuk urutan mungkin menetap.
A simpler form of parameter retrieval which does not use a format string to specify the types of the arguments. Functions which use this method to retrieve their parameters should be declared as :c:macro:`METH_VARARGS` in function or method tables. The tuple containing the actual parameters should be passed as *args*; it must actually be a tuple. The length of the tuple must be at least *min* and no more than *max*; *min* and *max* may be equal. Additional arguments must be passed to the function, each of which should be a pointer to a :c:expr:`PyObject*` variable; these will be filled in with the values from *args*; they will contain :term:`borrowed references <borrowed reference>`. The variables which correspond to optional parameters not given by *args* will not be filled in; these should be initialized by the caller. This function returns true on success and false if *args* is not a tuple or contains the wrong number of elements; an exception will be set if there was a failure.
Bentuk pengambilan parameter yang lebih sederhana yang tidak menggunakan string format untuk menentukan jenis argumen. Fungsi yang menggunakan metode ini untuk mengambil parameter harus dideklarasikan sebagai :c:macro:`METH_VARARGS` dalam tabel fungsi atau metode. Tuple yang berisi parameter aktual harus diberikan sebagai * args*; harus benar-benar sebuah tuple. Panjang tuple harus setidaknya *min* dan tidak lebih dari *max*; nilsi *min* dan *max* boleh sama. Argumen tambahan harus dilewatkan ke fungsi, yang masing-masing harus berupa penunjuk ke variabel :c:expr:`PyObject*`; ini akan diisi dengan nilai dari *args*; mereka akan berisi :term: `referensi yang dipinjam <borrowed reference>`. Variabel-variabel yang berhubungan dengan parameter opsional yang tidak diberikan oleh *args* tidak akan diisi; variabel-variabel ini harus diinisialisasi oleh pemanggil. Fungsi ini mengembalikan nilai true jika berhasil dan false jika *args* bukan sebuah tuple atau berisi jumlah elemen yang salah; sebuah pengecualian akan ditetapkan jika terjadi kegagalan.
Convert a C string and its length to a Python :class:`str` object using ``'utf-8'`` encoding. If the C string pointer is ``NULL``, the length is ignored and ``None`` is returned.
This converts a C string and its lengths to a Python object. If the C string pointer is ``NULL``, ``None`` is returned.
Convert a Unicode (UTF-16 or UCS-4) data buffer and its length to a Python Unicode object. If the Unicode buffer pointer is ``NULL``, the length is ignored and ``None`` is returned.
``c`` (:class:`bytes` of length 1) [char]
``c`` (:class:`bytes` dengan panjang 1) [char]
Convert a C :c:expr:`int` representing a byte to a Python :class:`bytes` object of length 1.
Mengonversi C :c:expr:`int` yang mewakili byte menjadi objek Python :class:`bytes` dengan panjang 1.
Convert a C :c:expr:`int` representing a character to Python :class:`str` object of length 1.
Mengonversi C :c:expr:`int` yang mewakili karakter ke objek Python :class:`str` dengan panjang 1.