|
1 | 1 | # -*- coding: utf-8 -*-
|
2 |
| -# Autogenerated by Sphinx on Mon Jun 28 10:13:28 2021 |
| 2 | +# Autogenerated by Sphinx on Mon Aug 30 20:40:44 2021 |
3 | 3 | topics = {'assert': 'The "assert" statement\n'
|
4 | 4 | '**********************\n'
|
5 | 5 | '\n'
|
|
1259 | 1259 | 'In the latter case, sequence repetition is performed; a negative\n'
|
1260 | 1260 | 'repetition factor yields an empty sequence.\n'
|
1261 | 1261 | '\n'
|
| 1262 | + 'This operation can be customized using the special "__mul__()" ' |
| 1263 | + 'and\n' |
| 1264 | + '"__rmul__()" methods.\n' |
| 1265 | + '\n' |
1262 | 1266 | 'The "@" (at) operator is intended to be used for matrix\n'
|
1263 | 1267 | 'multiplication. No builtin Python types implement this operator.\n'
|
1264 | 1268 | '\n'
|
|
1274 | 1278 | 'result. Division by zero raises the "ZeroDivisionError" '
|
1275 | 1279 | 'exception.\n'
|
1276 | 1280 | '\n'
|
| 1281 | + 'This operation can be customized using the special "__truediv__()" ' |
| 1282 | + 'and\n' |
| 1283 | + '"__floordiv__()" methods.\n' |
| 1284 | + '\n' |
1277 | 1285 | 'The "%" (modulo) operator yields the remainder from the division '
|
1278 | 1286 | 'of\n'
|
1279 | 1287 | 'the first argument by the second. The numeric arguments are '
|
|
1305 | 1313 | 'string formatting is described in the Python Library Reference,\n'
|
1306 | 1314 | 'section printf-style String Formatting.\n'
|
1307 | 1315 | '\n'
|
| 1316 | + 'The *modulo* operation can be customized using the special ' |
| 1317 | + '"__mod__()"\n' |
| 1318 | + 'method.\n' |
| 1319 | + '\n' |
1308 | 1320 | 'The floor division operator, the modulo operator, and the '
|
1309 | 1321 | '"divmod()"\n'
|
1310 | 1322 | 'function are not defined for complex numbers. Instead, convert to '
|
|
1319 | 1331 | 'and then added together. In the latter case, the sequences are\n'
|
1320 | 1332 | 'concatenated.\n'
|
1321 | 1333 | '\n'
|
| 1334 | + 'This operation can be customized using the special "__add__()" ' |
| 1335 | + 'and\n' |
| 1336 | + '"__radd__()" methods.\n' |
| 1337 | + '\n' |
1322 | 1338 | 'The "-" (subtraction) operator yields the difference of its '
|
1323 | 1339 | 'arguments.\n'
|
1324 |
| - 'The numeric arguments are first converted to a common type.\n', |
| 1340 | + 'The numeric arguments are first converted to a common type.\n' |
| 1341 | + '\n' |
| 1342 | + 'This operation can be customized using the special "__sub__()" ' |
| 1343 | + 'method.\n', |
1325 | 1344 | 'bitwise': 'Binary bitwise operations\n'
|
1326 | 1345 | '*************************\n'
|
1327 | 1346 | '\n'
|
|
1334 | 1353 | '\n'
|
1335 | 1354 | 'The "&" operator yields the bitwise AND of its arguments, which '
|
1336 | 1355 | 'must\n'
|
1337 |
| - 'be integers.\n' |
| 1356 | + 'be integers or one of them must be a custom object overriding\n' |
| 1357 | + '"__and__()" or "__rand__()" special methods.\n' |
1338 | 1358 | '\n'
|
1339 | 1359 | 'The "^" operator yields the bitwise XOR (exclusive OR) of its\n'
|
1340 |
| - 'arguments, which must be integers.\n' |
| 1360 | + 'arguments, which must be integers or one of them must be a ' |
| 1361 | + 'custom\n' |
| 1362 | + 'object overriding "__xor__()" or "__rxor__()" special methods.\n' |
1341 | 1363 | '\n'
|
1342 | 1364 | 'The "|" operator yields the bitwise (inclusive) OR of its '
|
1343 | 1365 | 'arguments,\n'
|
1344 |
| - 'which must be integers.\n', |
| 1366 | + 'which must be integers or one of them must be a custom object\n' |
| 1367 | + 'overriding "__or__()" or "__ror__()" special methods.\n', |
1345 | 1368 | 'bltin-code-objects': 'Code Objects\n'
|
1346 | 1369 | '************\n'
|
1347 | 1370 | '\n'
|
|
1787 | 1810 | ' comp_operator ::= "<" | ">" | "==" | ">=" | "<=" | "!="\n'
|
1788 | 1811 | ' | "is" ["not"] | ["not"] "in"\n'
|
1789 | 1812 | '\n'
|
1790 |
| - 'Comparisons yield boolean values: "True" or "False".\n' |
| 1813 | + 'Comparisons yield boolean values: "True" or "False". Custom ' |
| 1814 | + '*rich\n' |
| 1815 | + 'comparison methods* may return non-boolean values. In this ' |
| 1816 | + 'case Python\n' |
| 1817 | + 'will call "bool()" on such value in boolean contexts.\n' |
1791 | 1818 | '\n'
|
1792 | 1819 | 'Comparisons can be chained arbitrarily, e.g., "x < y <= z" '
|
1793 | 1820 | 'is\n'
|
|
7472 | 7499 | '"ZeroDivisionError".\n'
|
7473 | 7500 | 'Raising a negative number to a fractional power results in a '
|
7474 | 7501 | '"complex"\n'
|
7475 |
| - 'number. (In earlier versions it raised a "ValueError".)\n', |
| 7502 | + 'number. (In earlier versions it raised a "ValueError".)\n' |
| 7503 | + '\n' |
| 7504 | + 'This operation can be customized using the special "__pow__()" ' |
| 7505 | + 'method.\n', |
7476 | 7506 | 'raise': 'The "raise" statement\n'
|
7477 | 7507 | '*********************\n'
|
7478 | 7508 | '\n'
|
|
7872 | 7902 | 'the\n'
|
7873 | 7903 | 'second argument.\n'
|
7874 | 7904 | '\n'
|
| 7905 | + 'This operation can be customized using the special ' |
| 7906 | + '"__lshift__()" and\n' |
| 7907 | + '"__rshift__()" methods.\n' |
| 7908 | + '\n' |
7875 | 7909 | 'A right shift by *n* bits is defined as floor division by '
|
7876 | 7910 | '"pow(2,n)".\n'
|
7877 | 7911 | 'A left shift by *n* bits is defined as multiplication with '
|
|
10092 | 10126 | '*start* and\n'
|
10093 | 10127 | ' *end* are interpreted as in slice notation.\n'
|
10094 | 10128 | '\n'
|
10095 |
| - "str.encode(encoding='utf-8', errors='strict')\n" |
| 10129 | + 'str.encode(encoding="utf-8", errors="strict")\n' |
10096 | 10130 | '\n'
|
10097 | 10131 | ' Return an encoded version of the string as a bytes '
|
10098 | 10132 | 'object. Default\n'
|
|
10598 | 10632 | 'followed by\n'
|
10599 | 10633 | ' the string itself.\n'
|
10600 | 10634 | '\n'
|
10601 |
| - 'str.rsplit(sep=None, maxsplit=- 1)\n' |
| 10635 | + 'str.rsplit(sep=None, maxsplit=-1)\n' |
10602 | 10636 | '\n'
|
10603 | 10637 | ' Return a list of the words in the string, using *sep* '
|
10604 | 10638 | 'as the\n'
|
|
10639 | 10673 | " >>> 'Monty Python'.removesuffix(' Python')\n"
|
10640 | 10674 | " 'Monty'\n"
|
10641 | 10675 | '\n'
|
10642 |
| - 'str.split(sep=None, maxsplit=- 1)\n' |
| 10676 | + 'str.split(sep=None, maxsplit=-1)\n' |
10643 | 10677 | '\n'
|
10644 | 10678 | ' Return a list of the words in the string, using *sep* '
|
10645 | 10679 | 'as the\n'
|
|
11611 | 11645 | ' points. All the code points in the range "U+0000 - '
|
11612 | 11646 | 'U+10FFFF"\n'
|
11613 | 11647 | ' can be represented in a string. Python doesn’t have a '
|
11614 |
| - '*char*\n' |
| 11648 | + '"char"\n' |
11615 | 11649 | ' type; instead, every code point in the string is '
|
11616 | 11650 | 'represented\n'
|
11617 | 11651 | ' as a string object with length "1". The built-in '
|
|
13419 | 13453 | '| | "s[i:i] = '
|
13420 | 13454 | '[x]") | |\n'
|
13421 | 13455 | '+--------------------------------+----------------------------------+-----------------------+\n'
|
13422 |
| - '| "s.pop([i])" | retrieves the item at *i* ' |
| 13456 | + '| "s.pop()" or "s.pop(i)" | retrieves the item at *i* ' |
13423 | 13457 | 'and | (2) |\n'
|
13424 | 13458 | '| | also removes it from '
|
13425 | 13459 | '*s* | |\n'
|
|
13882 | 13916 | '| | "s[i:i] = '
|
13883 | 13917 | '[x]") | |\n'
|
13884 | 13918 | '+--------------------------------+----------------------------------+-----------------------+\n'
|
13885 |
| - '| "s.pop([i])" | retrieves the item at ' |
| 13919 | + '| "s.pop()" or "s.pop(i)" | retrieves the item at ' |
13886 | 13920 | '*i* and | (2) |\n'
|
13887 | 13921 | '| | also removes it from '
|
13888 | 13922 | '*s* | |\n'
|
@@ -13947,15 +13981,21 @@
|
13947 | 13981 | ' u_expr ::= power | "-" u_expr | "+" u_expr | "~" u_expr\n'
|
13948 | 13982 | '\n'
|
13949 | 13983 | 'The unary "-" (minus) operator yields the negation of its numeric\n'
|
13950 |
| - 'argument.\n' |
| 13984 | + 'argument; the operation can be overridden with the "__neg__()" ' |
| 13985 | + 'special\n' |
| 13986 | + 'method.\n' |
13951 | 13987 | '\n'
|
13952 | 13988 | 'The unary "+" (plus) operator yields its numeric argument '
|
13953 |
| - 'unchanged.\n' |
| 13989 | + 'unchanged;\n' |
| 13990 | + 'the operation can be overridden with the "__pos__()" special ' |
| 13991 | + 'method.\n' |
13954 | 13992 | '\n'
|
13955 | 13993 | 'The unary "~" (invert) operator yields the bitwise inversion of '
|
13956 | 13994 | 'its\n'
|
13957 | 13995 | 'integer argument. The bitwise inversion of "x" is defined as\n'
|
13958 |
| - '"-(x+1)". It only applies to integral numbers.\n' |
| 13996 | + '"-(x+1)". It only applies to integral numbers or to custom ' |
| 13997 | + 'objects\n' |
| 13998 | + 'that override the "__invert__()" special method.\n' |
13959 | 13999 | '\n'
|
13960 | 14000 | 'In all three cases, if the argument does not have the proper type, '
|
13961 | 14001 | 'a\n'
|
|
0 commit comments