| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 96c744d commit 10e4274
19 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -12,7 +12,7 @@ msgid "" | |||
| 12 | 12 | msgstr "" | |
| 13 | 13 | "Project-Id-Version: Python 3.15\n" | |
| 14 | 14 | "Report-Msgid-Bugs-To: \n" | |
| 15 | - "POT-Creation-Date: 2026-10-03 17:41+0000\n" | ||
| 15 | + "POT-Creation-Date: 2026-10-13 19:59+0000\n" | ||
| 16 | 16 | "PO-Revision-Date: 2026-09-13 17:09+0000\n" | |
| 17 | 17 | "Last-Translator: Rafael Fontenelle <rffontenelle@gmail.com>, 2026\n" | |
| 18 | 18 | "Language-Team: Indonesian (https://app.transifex.com/python-doc/teams/5390/" | |
@@ -1084,7 +1084,7 @@ msgid "" | |||
| 1084 | 1084 | "using :func:`int` instead." | |
| 1085 | 1085 | msgstr "" | |
| 1086 | 1086 | ||
| 1087 | - msgid "Iterator Types" | ||
| 1087 | + msgid "Iteration-related types" | ||
| 1088 | 1088 | msgstr "" | |
| 1089 | 1089 | ||
| 1090 | 1090 | msgid "" | |
@@ -1094,6 +1094,9 @@ msgid "" | |||
| 1094 | 1094 | "support the iteration methods." | |
| 1095 | 1095 | msgstr "" | |
| 1096 | 1096 | ||
| 1097 | + msgid "Iterables" | ||
| 1098 | + msgstr "" | ||
| 1099 | + | ||
| 1097 | 1100 | msgid "" | |
| 1098 | 1101 | "One method needs to be defined for container objects to provide :term:" | |
| 1099 | 1102 | "`iterable` support:" | |
@@ -1110,6 +1113,9 @@ msgid "" | |||
| 1110 | 1113 | "in the Python/C API." | |
| 1111 | 1114 | msgstr "" | |
| 1112 | 1115 | ||
| 1116 | + msgid "Iterators" | ||
| 1117 | + msgstr "*Iterators*" | ||
| 1118 | + | ||
| 1113 | 1119 | msgid "" | |
| 1114 | 1120 | "The iterator objects themselves are required to support the following two " | |
| 1115 | 1121 | "methods, which together form the :dfn:`iterator protocol`:" | |
@@ -1142,17 +1148,298 @@ msgid "" | |||
| 1142 | 1148 | "Implementations that do not obey this property are deemed broken." | |
| 1143 | 1149 | msgstr "" | |
| 1144 | 1150 | ||
| 1145 | - msgid "Generator Types" | ||
| 1151 | + msgid "Generator types" | ||
| 1152 | + msgstr "" | ||
| 1153 | + | ||
| 1154 | + msgid "" | ||
| 1155 | + "Python's :term:`generators <generator>` -- or more precisely, :term:" | ||
| 1156 | + "`generator functions <generator function>` and :term:`generator iterators " | ||
| 1157 | + "<generator iterator>` -- provide a convenient way to implement the iterator " | ||
| 1158 | + "protocol." | ||
| 1159 | + msgstr "" | ||
| 1160 | + | ||
| 1161 | + msgid "" | ||
| 1162 | + "A function that contains one or more :ref:`yield expressions <yieldexpr>` is " | ||
| 1163 | + "a :term:`generator function`. For example::" | ||
| 1164 | + msgstr "" | ||
| 1165 | + | ||
| 1166 | + msgid "" | ||
| 1167 | + ">>> def count_to_three():\n" | ||
| 1168 | + "... yield 0\n" | ||
| 1169 | + "... yield 1\n" | ||
| 1170 | + "... yield 2\n" | ||
| 1171 | + "... yield 3" | ||
| 1172 | + msgstr "" | ||
| 1173 | + | ||
| 1174 | + msgid "" | ||
| 1175 | + "Generator functions behave as regular :ref:`user-defined functions <user-" | ||
| 1176 | + "defined-funcs>` (for example, they have the same attributes), except that " | ||
| 1177 | + "calling a generator function returns a :ref:`generator iterator <generator-" | ||
| 1178 | + "methods>`::" | ||
| 1179 | + msgstr "" | ||
| 1180 | + | ||
| 1181 | + msgid "" | ||
| 1182 | + ">>> count_to_three()\n" | ||
| 1183 | + "<generator object count_to_three at 0x7f33a2305000>" | ||
| 1184 | + msgstr "" | ||
| 1185 | + | ||
| 1186 | + msgid "" | ||
| 1187 | + "Iterating a generator iterator executes code of the underlying generator " | ||
| 1188 | + "function, producing each :keyword:`yield`\\ed value in turn::" | ||
| 1189 | + msgstr "" | ||
| 1190 | + | ||
| 1191 | + msgid "" | ||
| 1192 | + ">>> for number in count_to_three():\n" | ||
| 1193 | + "... print(number)\n" | ||
| 1194 | + "0\n" | ||
| 1195 | + "1\n" | ||
| 1196 | + "2\n" | ||
| 1197 | + "3\n" | ||
| 1198 | + "\n" | ||
| 1199 | + ">>> list(count_to_three())\n" | ||
| 1200 | + "[0, 1, 2, 3]" | ||
| 1201 | + msgstr "" | ||
| 1202 | + | ||
| 1203 | + msgid "" | ||
| 1204 | + "One common use for generator functions is implementing the :meth:`~object." | ||
| 1205 | + "__iter__` method of custom iterable objects. For example::" | ||
| 1206 | + msgstr "" | ||
| 1207 | + | ||
| 1208 | + msgid "" | ||
| 1209 | + ">>> class CardDeck:\n" | ||
| 1210 | + "... def __iter__(self):\n" | ||
| 1211 | + "... yield 'three of clubs'\n" | ||
| 1212 | + "... yield 'ace of hearts'\n" | ||
| 1213 | + "\n" | ||
| 1214 | + ">>> list(CardDeck())\n" | ||
| 1215 | + "['three of clubs', 'ace of hearts']" | ||
| 1216 | + msgstr "" | ||
| 1217 | + | ||
| 1218 | + msgid "Generator iterators" | ||
| 1219 | + msgstr "" | ||
| 1220 | + | ||
| 1221 | + msgid "" | ||
| 1222 | + "Generator iterators implement the :ref:`iterator protocol <stdtypes-" | ||
| 1223 | + "iterators>`. Iterating them drives execution of the underlying generator " | ||
| 1224 | + "function." | ||
| 1225 | + msgstr "" | ||
| 1226 | + | ||
| 1227 | + msgid "" | ||
| 1228 | + "Starts the execution of a generator function or resumes it at the :ref:" | ||
| 1229 | + "`yield expression <yieldexpr>` where the function is currently suspended. " | ||
| 1230 | + "When a generator function is resumed with a :meth:`~generator.__next__` " | ||
| 1231 | + "method, the current yield expression always evaluates to :const:`None`. The " | ||
| 1232 | + "execution then continues to the next yield expression, where the generator " | ||
| 1233 | + "is suspended again, and the value of the expression after the :keyword:" | ||
| 1234 | + "`yield` keyword is returned to :meth:`~generator.__next__`'s caller. If the " | ||
| 1235 | + "generator exits without yielding another value, :meth:`~generator.__next__` " | ||
| 1236 | + "raises a :exc:`StopIteration` exception, signalling that iteration has " | ||
| 1237 | + "completed." | ||
| 1238 | + msgstr "" | ||
| 1239 | + | ||
| 1240 | + msgid "" | ||
| 1241 | + "This method is normally called implicitly, for example by a :keyword:`for` " | ||
| 1242 | + "loop, or by the built-in :func:`next` function." | ||
| 1243 | + msgstr "" | ||
| 1244 | + | ||
| 1245 | + msgid "" | ||
| 1246 | + "Generator iterators have a few more methods than generic iterators, which " | ||
| 1247 | + "can be used to control the execution of the underlying generator function:" | ||
| 1248 | + msgstr "" | ||
| 1249 | + | ||
| 1250 | + msgid "" | ||
| 1251 | + "\"Sends\" a value into the generator function: the *value* argument becomes " | ||
| 1252 | + "the result of the current yield expression." | ||
| 1253 | + msgstr "" | ||
| 1254 | + | ||
| 1255 | + msgid "" | ||
| 1256 | + "Otherwise, this method behaves like :meth:`~generator.__next__`: it resumes " | ||
| 1257 | + "the underlying function and either returns the next yielded value or raises :" | ||
| 1258 | + "exc:`StopIteration`." | ||
| 1259 | + msgstr "" | ||
| 1260 | + | ||
| 1261 | + msgid "" | ||
| 1262 | + "When :meth:`send` is called to start the generator, it must be called with :" | ||
| 1263 | + "const:`None` as the argument, because there is no current yield expression " | ||
| 1264 | + "that could receive the value." | ||
| 1265 | + msgstr "" | ||
| 1266 | + | ||
| 1267 | + msgid "" | ||
| 1268 | + "Raises an exception at the point where the generator is currently suspended." | ||
| 1269 | + msgstr "" | ||
| 1270 | + | ||
| 1271 | + msgid "" | ||
| 1272 | + "Otherwise, this method behaves like :meth:`~generator.__next__`: it resumes " | ||
| 1273 | + "the underlying function and either returns the next yielded value or raises :" | ||
| 1274 | + "exc:`StopIteration`. If the generator function does not catch the passed-in " | ||
| 1275 | + "exception, or raises a different exception, then that exception propagates " | ||
| 1276 | + "to the caller." | ||
| 1277 | + msgstr "" | ||
| 1278 | + | ||
| 1279 | + msgid "" | ||
| 1280 | + "When :meth:`throw` is called to start the generator, the generator " | ||
| 1281 | + "immediately exits (that is, subsequent calls to :meth:`~generator.__next__` " | ||
| 1282 | + "will raise :exc:`StopIteration`) and the thrown exception is propagated to :" | ||
| 1283 | + "meth:`throw`'s caller." | ||
| 1284 | + msgstr "" | ||
| 1285 | + | ||
| 1286 | + msgid "" | ||
| 1287 | + "In typical use, this is called with a single argument, an exception " | ||
| 1288 | + "instance, similar to the way the :keyword:`raise` keyword is used." | ||
| 1289 | + msgstr "" | ||
| 1290 | + | ||
| 1291 | + msgid "" | ||
| 1292 | + "For backwards compatibility, however, the second signature is supported, " | ||
| 1293 | + "following a convention from older versions of Python. The *type* argument " | ||
| 1294 | + "should be an exception class, and *value* should be an exception instance. " | ||
| 1295 | + "If the *value* is not provided, the *type* constructor is called to get an " | ||
| 1296 | + "instance. If *traceback* is provided, it is set on the exception, otherwise " | ||
| 1297 | + "any existing :attr:`~BaseException.__traceback__` attribute stored in " | ||
| 1298 | + "*value* may be cleared." | ||
| 1299 | + msgstr "" | ||
| 1300 | + | ||
| 1301 | + msgid "" | ||
| 1302 | + "The second signature \\(type\\[, value\\[, traceback\\]\\]\\) is deprecated " | ||
| 1303 | + "and may be removed in a future version of Python." | ||
| 1304 | + msgstr "" | ||
| 1305 | + | ||
| 1306 | + msgid "" | ||
| 1307 | + "Raises a :exc:`GeneratorExit` exception at the point where the generator " | ||
| 1308 | + "function is currently suspended (equivalent to calling " | ||
| 1309 | + "``throw(GeneratorExit)``)." | ||
| 1310 | + msgstr "" | ||
| 1311 | + | ||
| 1312 | + msgid "" | ||
| 1313 | + "If the generator function has already exited (due to an exception or normal " | ||
| 1314 | + "return), or raises :exc:`GeneratorExit` (by not catching the exception), :" | ||
| 1315 | + "meth:`close` returns :const:`None`. If the generator yields a value, a :exc:" | ||
| 1316 | + "`RuntimeError` is raised. If the generator raises any other exception, it is " | ||
| 1317 | + "propagated to the caller. If a generator returns a value upon being closed, " | ||
| 1318 | + "that value is returned by :meth:`close`." | ||
| 1319 | + msgstr "" | ||
| 1320 | + | ||
| 1321 | + msgid "" | ||
| 1322 | + "When a generator iterator is garbage collected before it has exited, :meth:" | ||
| 1323 | + "`~generator.close` is called automatically." | ||
| 1324 | + msgstr "" | ||
| 1325 | + | ||
| 1326 | + msgid "" | ||
| 1327 | + "If a generator returns a value upon being closed, the value is returned by :" | ||
| 1328 | + "meth:`close`. Previously, it returned ``None``." | ||
| 1329 | + msgstr "" | ||
| 1330 | + | ||
| 1331 | + msgid "" | ||
| 1332 | + "Calling any of the generator methods (:meth:`~generator.__next__`, :meth:" | ||
| 1333 | + "`~generator.send`, :meth:`~generator.throw`, :meth:`~generator.close`) while " | ||
| 1334 | + "one of these methods is already executing raises a :exc:`ValueError` " | ||
| 1335 | + "exception." | ||
| 1336 | + msgstr "" | ||
| 1337 | + | ||
| 1338 | + msgid "Asynchronous generator iterators" | ||
| 1339 | + msgstr "" | ||
| 1340 | + | ||
| 1341 | + msgid "" | ||
| 1342 | + "This subsection describes the methods of an asynchronous generator iterator, " | ||
| 1343 | + "which are used to control the execution of an asynchronous generator " | ||
| 1344 | + "function." | ||
| 1345 | + msgstr "" | ||
| 1346 | + | ||
| 1347 | + msgid "" | ||
| 1348 | + "Returns an :term:`awaitable` which when run starts to execute the " | ||
| 1349 | + "asynchronous generator function or resumes it at the :ref:`yield expression " | ||
| 1350 | + "<yieldexpr>` where the function is currently suspended. When an asynchronous " | ||
| 1351 | + "generator function is resumed with an :meth:`~agen.__anext__` method, the " | ||
| 1352 | + "current yield expression always evaluates to :const:`None` in the returned " | ||
| 1353 | + "awaitable, which when run will continue to the next yield expression. The " | ||
| 1354 | + "value of the expression after the :keyword:`yield` keyword is the value of " | ||
| 1355 | + "the :exc:`StopIteration` exception raised by the completing coroutine. If " | ||
| 1356 | + "the asynchronous generator exits without yielding another value, the " | ||
| 1357 | + "awaitable instead raises a :exc:`StopAsyncIteration` exception, signalling " | ||
| 1358 | + "that the asynchronous iteration has completed." | ||
| 1359 | + msgstr "" | ||
| 1360 | + | ||
| 1361 | + msgid "" | ||
| 1362 | + "This method is normally called implicitly by an :keyword:`async for` loop, " | ||
| 1363 | + "or by the built-in :func:`anext` function." | ||
| 1364 | + msgstr "" | ||
| 1365 | + | ||
| 1366 | + msgid "" | ||
| 1367 | + "Asynchronous generator-iterators have a few more methods than generic " | ||
| 1368 | + "asynchronous iterators, which can be used to control the execution of the " | ||
| 1369 | + "underlying generator function:" | ||
| 1370 | + msgstr "" | ||
| 1371 | + | ||
| 1372 | + msgid "" | ||
| 1373 | + "Returns an awaitable which, when run, \"sends\" a value into the underlying " | ||
| 1374 | + "asynchronous generator function: the *value* argument becomes the result of " | ||
| 1375 | + "the current yield expression." | ||
| 1376 | + msgstr "" | ||
| 1377 | + | ||
| 1378 | + msgid "" | ||
| 1379 | + "Otherwise, this method behaves like :meth:`~agen.__anext__`: when the " | ||
| 1380 | + "returned awaitable runs, it resumes the underlying function and either " | ||
| 1381 | + "returns the next yielded value as the value of the raised :exc:" | ||
| 1382 | + "`StopIteration`, or raises :exc:`StopAsyncIteration`." | ||
| 1383 | + msgstr "" | ||
| 1384 | + | ||
| 1385 | + msgid "" | ||
| 1386 | + "When :meth:`asend` is called to start the asynchronous generator, it must be " | ||
| 1387 | + "called with :const:`None` as the argument, because there is no yield " | ||
| 1388 | + "expression that could receive the value." | ||
| 1389 | + msgstr "" | ||
| 1390 | + | ||
| 1391 | + msgid "" | ||
| 1392 | + "Returns an awaitable that, when run, raises an exception at the point where " | ||
| 1393 | + "the underlying asynchronous generator function is currently suspended." | ||
| 1146 | 1394 | msgstr "" | |
| 1147 | 1395 | ||
| 1148 | 1396 | msgid "" | |
| 1149 | - "Python's :term:`generator`\\s provide a convenient way to implement the " | ||
| 1150 | - "iterator protocol. If a container object's :meth:`~object.__iter__` method " | ||
| 1151 | - "is implemented as a generator, it will automatically return an iterator " | ||
| 1152 | - "object (technically, a generator object) supplying the :meth:`~iterator." | ||
| 1153 | - "__iter__` and :meth:`~generator.__next__` methods. More information about " | ||
| 1154 | - "generators can be found in :ref:`the documentation for the yield expression " | ||
| 1155 | - "<yieldexpr>`." | ||
| 1397 | + "Otherwise, this method behaves like :meth:`~agen.__anext__`: when the " | ||
| 1398 | + "returned awaitable runs, it resumes the underlying function (with an " | ||
| 1399 | + "exception raised) and either returns the next yielded value as the value of " | ||
| 1400 | + "the raised :exc:`StopIteration`, or raises :exc:`StopAsyncIteration`. If the " | ||
| 1401 | + "underlying function does not catch the passed-in exception, or raises a " | ||
| 1402 | + "different exception, then when the awaitable is run, that exception " | ||
| 1403 | + "propagates to the caller of the awaitable." | ||
| 1404 | + msgstr "" | ||
| 1405 | + | ||
| 1406 | + msgid "" | ||
| 1407 | + "When :meth:`~agen.athrow` is called to start the generator, the generator " | ||
| 1408 | + "exits when the awaitable runs (that is, subsequent results from :meth:`~agen." | ||
| 1409 | + "__anext__` will raise :exc:`StopAsyncIteration` when run) and the thrown " | ||
| 1410 | + "exception is propagated to the awaitable's caller." | ||
| 1411 | + msgstr "" | ||
| 1412 | + | ||
| 1413 | + msgid "" | ||
| 1414 | + "For backwards compatibility, however, the second signature is supported. An " | ||
| 1415 | + "exception instance is created from three arguments in the same way as in :" | ||
| 1416 | + "meth:`generator.throw`." | ||
| 1417 | + msgstr "" | ||
| 1418 | + | ||
| 1419 | + msgid "" | ||
| 1420 | + "Returns an awaitable that when run will throw a :exc:`GeneratorExit` into " | ||
| 1421 | + "the underlying asynchronous generator function at the point where it is " | ||
| 1422 | + "currently suspended (equivalent to calling ``athrow(GeneratorExit)``)." | ||
| 1423 | + msgstr "" | ||
| 1424 | + | ||
| 1425 | + msgid "" | ||
| 1426 | + "If the asynchronous generator function then exits gracefully, is already " | ||
| 1427 | + "closed, or raises :exc:`GeneratorExit` (by not catching the exception), then " | ||
| 1428 | + "the returned awaitable will raise a :exc:`StopIteration` exception. Any " | ||
| 1429 | + "further awaitables returned by subsequent calls to the asynchronous " | ||
| 1430 | + "generator will raise a :exc:`StopAsyncIteration` exception." | ||
| 1431 | + msgstr "" | ||
| 1432 | + | ||
| 1433 | + msgid "" | ||
| 1434 | + "If the asynchronous generator yields a value, a :exc:`RuntimeError` is " | ||
| 1435 | + "raised by the awaitable. If the asynchronous generator raises any other " | ||
| 1436 | + "exception, that exception is propagated to the caller of the awaitable." | ||
| 1437 | + msgstr "" | ||
| 1438 | + | ||
| 1439 | + msgid "" | ||
| 1440 | + "If the asynchronous generator has already exited due to an exception or " | ||
| 1441 | + "normal exit, then further calls to :meth:`aclose` will return an awaitable " | ||
| 1442 | + "that does nothing." | ||
| 1156 | 1443 | msgstr "" | |
| 1157 | 1444 | ||
| 1158 | 1445 | msgid "Sequence Types --- :class:`list`, :class:`tuple`, :class:`range`" | |
@@ -7643,6 +7930,24 @@ msgstr "" | |||
| 7643 | 7930 | msgid "iteration over" | |
| 7644 | 7931 | msgstr "" | |
| 7645 | 7932 | ||
| 7933 | + msgid "generator" | ||
| 7934 | + msgstr "pembangkit" | ||
| 7935 | + | ||
| 7936 | + msgid "exception" | ||
| 7937 | + msgstr "" | ||
| 7938 | + | ||
| 7939 | + msgid "StopIteration" | ||
| 7940 | + msgstr "" | ||
| 7941 | + | ||
| 7942 | + msgid "GeneratorExit" | ||
| 7943 | + msgstr "" | ||
| 7944 | + | ||
| 7945 | + msgid "asynchronous-generator" | ||
| 7946 | + msgstr "" | ||
| 7947 | + | ||
| 7948 | + msgid "StopAsyncIteration" | ||
| 7949 | + msgstr "" | ||
| 7950 | + | ||
| 7646 | 7951 | msgid "len" | |
| 7647 | 7952 | msgstr "len" | |
| 7648 | 7953 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -12,7 +12,7 @@ msgid "" | |||
| 12 | 12 | msgstr "" | |
| 13 | 13 | "Project-Id-Version: Python 3.15\n" | |
| 14 | 14 | "Report-Msgid-Bugs-To: \n" | |
| 15 | - "POT-Creation-Date: 2026-09-23 18:03+0000\n" | ||
| 15 | + "POT-Creation-Date: 2026-10-13 19:59+0000\n" | ||
| 16 | 16 | "PO-Revision-Date: 2025-09-16 00:00+0000\n" | |
| 17 | 17 | "Last-Translator: Hengky Kurniawan, 2025\n" | |
| 18 | 18 | "Language-Team: Indonesian (https://app.transifex.com/python-doc/teams/5390/" | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -12,7 +12,7 @@ msgid "" | |||
| 12 | 12 | msgstr "" | |
| 13 | 13 | "Project-Id-Version: Python 3.15\n" | |
| 14 | 14 | "Report-Msgid-Bugs-To: \n" | |
| 15 | - "POT-Creation-Date: 2026-09-23 18:03+0000\n" | ||
| 15 | + "POT-Creation-Date: 2026-10-13 19:59+0000\n" | ||
| 16 | 16 | "PO-Revision-Date: 2025-09-16 00:00+0000\n" | |
| 17 | 17 | "Last-Translator: Hengky Kurniawan, 2025\n" | |
| 18 | 18 | "Language-Team: Indonesian (https://app.transifex.com/python-doc/teams/5390/" | |
| Back | FazBrowse Home | New Git URL |
0 commit comments