|
1 | 1 | # -*- coding: utf-8 -*-
|
2 |
| -# Autogenerated by Sphinx on Thu Jun 27 15:02:53 2024 |
| 2 | +# Autogenerated by Sphinx on Thu Jul 18 11:36:18 2024 |
3 | 3 | # as part of the release process.
|
4 | 4 | topics = {'assert': 'The "assert" statement\n'
|
5 | 5 | '**********************\n'
|
|
308 | 308 | 'target.\n'
|
309 | 309 | 'The target is only evaluated once.\n'
|
310 | 310 | '\n'
|
311 |
| - 'An augmented assignment expression like "x += 1" can be ' |
312 |
| - 'rewritten as\n' |
313 |
| - '"x = x + 1" to achieve a similar, but not exactly equal ' |
314 |
| - 'effect. In the\n' |
| 311 | + 'An augmented assignment statement like "x += 1" can be ' |
| 312 | + 'rewritten as "x\n' |
| 313 | + '= x + 1" to achieve a similar, but not exactly equal effect. ' |
| 314 | + 'In the\n' |
315 | 315 | 'augmented version, "x" is only evaluated once. Also, when '
|
316 | 316 | 'possible,\n'
|
317 | 317 | 'the actual operation is performed *in-place*, meaning that '
|
|
560 | 560 | 'evaluate it\n'
|
561 | 561 | 'raises a "NameError" exception.\n'
|
562 | 562 | '\n'
|
563 |
| - '**Private name mangling:** When an identifier that ' |
564 |
| - 'textually occurs in\n' |
565 |
| - 'a class definition begins with two or more underscore ' |
566 |
| - 'characters and\n' |
567 |
| - 'does not end in two or more underscores, it is ' |
568 |
| - 'considered a *private\n' |
569 |
| - 'name* of that class. Private names are transformed to a ' |
570 |
| - 'longer form\n' |
571 |
| - 'before code is generated for them. The transformation ' |
572 |
| - 'inserts the\n' |
573 |
| - 'class name, with leading underscores removed and a ' |
574 |
| - 'single underscore\n' |
575 |
| - 'inserted, in front of the name. For example, the ' |
576 |
| - 'identifier "__spam"\n' |
577 |
| - 'occurring in a class named "Ham" will be transformed to ' |
578 |
| - '"_Ham__spam".\n' |
579 |
| - 'This transformation is independent of the syntactical ' |
| 563 | + '\n' |
| 564 | + 'Private name mangling\n' |
| 565 | + '=====================\n' |
| 566 | + '\n' |
| 567 | + 'When an identifier that textually occurs in a class ' |
| 568 | + 'definition begins\n' |
| 569 | + 'with two or more underscore characters and does not end ' |
| 570 | + 'in two or more\n' |
| 571 | + 'underscores, it is considered a *private name* of that ' |
| 572 | + 'class.\n' |
| 573 | + '\n' |
| 574 | + 'See also: The class specifications.\n' |
| 575 | + '\n' |
| 576 | + 'More precisely, private names are transformed to a ' |
| 577 | + 'longer form before\n' |
| 578 | + 'code is generated for them. If the transformed name is ' |
| 579 | + 'longer than\n' |
| 580 | + '255 characters, implementation-defined truncation may ' |
| 581 | + 'happen.\n' |
| 582 | + '\n' |
| 583 | + 'The transformation is independent of the syntactical ' |
580 | 584 | 'context in which\n'
|
581 |
| - 'the identifier is used. If the transformed name is ' |
582 |
| - 'extremely long\n' |
583 |
| - '(longer than 255 characters), implementation defined ' |
584 |
| - 'truncation may\n' |
585 |
| - 'happen. If the class name consists only of underscores, ' |
586 |
| - 'no\n' |
587 |
| - 'transformation is done.\n', |
| 585 | + 'the identifier is used but only the following private ' |
| 586 | + 'identifiers are\n' |
| 587 | + 'mangled:\n' |
| 588 | + '\n' |
| 589 | + '* Any name used as the name of a variable that is ' |
| 590 | + 'assigned or read or\n' |
| 591 | + ' any name of an attribute being accessed.\n' |
| 592 | + '\n' |
| 593 | + ' The "__name__" attribute of nested functions, classes, ' |
| 594 | + 'and type\n' |
| 595 | + ' aliases is however not mangled.\n' |
| 596 | + '\n' |
| 597 | + '* The name of imported modules, e.g., "__spam" in ' |
| 598 | + '"import __spam". If\n' |
| 599 | + ' the module is part of a package (i.e., its name ' |
| 600 | + 'contains a dot), the\n' |
| 601 | + ' name is *not* mangled, e.g., the "__foo" in "import ' |
| 602 | + '__foo.bar" is\n' |
| 603 | + ' not mangled.\n' |
| 604 | + '\n' |
| 605 | + '* The name of an imported member, e.g., "__f" in "from ' |
| 606 | + 'spam import\n' |
| 607 | + ' __f".\n' |
| 608 | + '\n' |
| 609 | + 'The transformation rule is defined as follows:\n' |
| 610 | + '\n' |
| 611 | + '* The class name, with leading underscores removed and a ' |
| 612 | + 'single\n' |
| 613 | + ' leading underscore inserted, is inserted in front of ' |
| 614 | + 'the identifier,\n' |
| 615 | + ' e.g., the identifier "__spam" occurring in a class ' |
| 616 | + 'named "Foo",\n' |
| 617 | + ' "_Foo" or "__Foo" is transformed to "_Foo__spam".\n' |
| 618 | + '\n' |
| 619 | + '* If the class name consists only of underscores, the ' |
| 620 | + 'transformation\n' |
| 621 | + ' is the identity, e.g., the identifier "__spam" ' |
| 622 | + 'occurring in a class\n' |
| 623 | + ' named "_" or "__" is left as is.\n', |
588 | 624 | 'atom-literals': 'Literals\n'
|
589 | 625 | '********\n'
|
590 | 626 | '\n'
|
|
1168 | 1204 | 'target.\n'
|
1169 | 1205 | 'The target is only evaluated once.\n'
|
1170 | 1206 | '\n'
|
1171 |
| - 'An augmented assignment expression like "x += 1" can be ' |
1172 |
| - 'rewritten as\n' |
1173 |
| - '"x = x + 1" to achieve a similar, but not exactly equal effect. ' |
1174 |
| - 'In the\n' |
| 1207 | + 'An augmented assignment statement like "x += 1" can be ' |
| 1208 | + 'rewritten as "x\n' |
| 1209 | + '= x + 1" to achieve a similar, but not exactly equal effect. In ' |
| 1210 | + 'the\n' |
1175 | 1211 | 'augmented version, "x" is only evaluated once. Also, when '
|
1176 | 1212 | 'possible,\n'
|
1177 | 1213 | 'the actual operation is performed *in-place*, meaning that '
|
|
1244 | 1280 | 'The "@" (at) operator is intended to be used for matrix\n'
|
1245 | 1281 | 'multiplication. No builtin Python types implement this operator.\n'
|
1246 | 1282 | '\n'
|
| 1283 | + 'This operation can be customized using the special "__matmul__()" ' |
| 1284 | + 'and\n' |
| 1285 | + '"__rmatmul__()" methods.\n' |
| 1286 | + '\n' |
1247 | 1287 | 'Added in version 3.5.\n'
|
1248 | 1288 | '\n'
|
1249 | 1289 | 'The "/" (division) and "//" (floor division) operators yield the\n'
|
|
1256 | 1296 | 'result. Division by zero raises the "ZeroDivisionError" '
|
1257 | 1297 | 'exception.\n'
|
1258 | 1298 | '\n'
|
1259 |
| - 'This operation can be customized using the special "__truediv__()" ' |
| 1299 | + 'The division operation can be customized using the special\n' |
| 1300 | + '"__truediv__()" and "__rtruediv__()" methods. The floor division\n' |
| 1301 | + 'operation can be customized using the special "__floordiv__()" ' |
1260 | 1302 | 'and\n'
|
1261 |
| - '"__floordiv__()" methods.\n' |
| 1303 | + '"__rfloordiv__()" methods.\n' |
1262 | 1304 | '\n'
|
1263 | 1305 | 'The "%" (modulo) operator yields the remainder from the division '
|
1264 | 1306 | 'of\n'
|
|
1293 | 1335 | '\n'
|
1294 | 1336 | 'The *modulo* operation can be customized using the special '
|
1295 | 1337 | '"__mod__()"\n'
|
1296 |
| - 'method.\n' |
| 1338 | + 'and "__rmod__()" methods.\n' |
1297 | 1339 | '\n'
|
1298 | 1340 | 'The floor division operator, the modulo operator, and the '
|
1299 | 1341 | '"divmod()"\n'
|
|
1318 | 1360 | 'The numeric arguments are first converted to a common type.\n'
|
1319 | 1361 | '\n'
|
1320 | 1362 | 'This operation can be customized using the special "__sub__()" '
|
1321 |
| - 'method.\n', |
| 1363 | + 'and\n' |
| 1364 | + '"__rsub__()" methods.\n', |
1322 | 1365 | 'bitwise': 'Binary bitwise operations\n'
|
1323 | 1366 | '*************************\n'
|
1324 | 1367 | '\n'
|
|
9310 | 9353 | '"complex"\n'
|
9311 | 9354 | 'number. (In earlier versions it raised a "ValueError".)\n'
|
9312 | 9355 | '\n'
|
9313 |
| - 'This operation can be customized using the special "__pow__()" ' |
9314 |
| - 'method.\n', |
| 9356 | + 'This operation can be customized using the special "__pow__()" and\n' |
| 9357 | + '"__rpow__()" methods.\n', |
9315 | 9358 | 'raise': 'The "raise" statement\n'
|
9316 | 9359 | '*********************\n'
|
9317 | 9360 | '\n'
|
|
9725 | 9768 | 'the\n'
|
9726 | 9769 | 'second argument.\n'
|
9727 | 9770 | '\n'
|
9728 |
| - 'This operation can be customized using the special ' |
9729 |
| - '"__lshift__()" and\n' |
9730 |
| - '"__rshift__()" methods.\n' |
| 9771 | + 'The left shift operation can be customized using the special\n' |
| 9772 | + '"__lshift__()" and "__rlshift__()" methods. The right shift ' |
| 9773 | + 'operation\n' |
| 9774 | + 'can be customized using the special "__rshift__()" and ' |
| 9775 | + '"__rrshift__()"\n' |
| 9776 | + 'methods.\n' |
9731 | 9777 | '\n'
|
9732 | 9778 | 'A right shift by *n* bits is defined as floor division by '
|
9733 | 9779 | '"pow(2,n)".\n'
|
@@ -12809,11 +12855,11 @@
|
12809 | 12855 | ' and are deemed to delimit empty strings (for example,\n'
|
12810 | 12856 | ' "\'1,,2\'.split(\',\')" returns "[\'1\', \'\', '
|
12811 | 12857 | '\'2\']"). The *sep* argument\n'
|
12812 |
| - ' may consist of multiple characters (for example,\n' |
12813 |
| - ' "\'1<>2<>3\'.split(\'<>\')" returns "[\'1\', \'2\', ' |
12814 |
| - '\'3\']"). Splitting an\n' |
12815 |
| - ' empty string with a specified separator returns ' |
12816 |
| - '"[\'\']".\n' |
| 12858 | + ' may consist of multiple characters as a single ' |
| 12859 | + 'delimiter (to split\n' |
| 12860 | + ' with multiple delimiters, use "re.split()"). Splitting ' |
| 12861 | + 'an empty\n' |
| 12862 | + ' string with a specified separator returns "[\'\']".\n' |
12817 | 12863 | '\n'
|
12818 | 12864 | ' For example:\n'
|
12819 | 12865 | '\n'
|
|
12823 | 12869 | " ['1', '2,3']\n"
|
12824 | 12870 | " >>> '1,2,,3,'.split(',')\n"
|
12825 | 12871 | " ['1', '2', '', '3', '']\n"
|
| 12872 | + " >>> '1<>2<>3<4'.split('<>')\n" |
| 12873 | + " ['1', '2', '3<4']\n" |
12826 | 12874 | '\n'
|
12827 | 12875 | ' If *sep* is not specified or is "None", a different '
|
12828 | 12876 | 'splitting\n'
|
|
15333 | 15381 | '\n'
|
15334 | 15382 | ' Return a shallow copy of the dictionary.\n'
|
15335 | 15383 | '\n'
|
15336 |
| - ' classmethod fromkeys(iterable, value=None)\n' |
| 15384 | + ' classmethod fromkeys(iterable, value=None, /)\n' |
15337 | 15385 | '\n'
|
15338 | 15386 | ' Create a new dictionary with keys from *iterable* and '
|
15339 | 15387 | 'values set\n'
|
|
0 commit comments