|
1 | 1 | # -*- coding: utf-8 -*-
|
2 |
| -# Autogenerated by Sphinx on Mon Dec 7 19:34:00 2020 |
| 2 | +# Autogenerated by Sphinx on Mon Jan 4 17:25:50 2021 |
3 | 3 | topics = {'assert': 'The "assert" statement\n'
|
4 | 4 | '**********************\n'
|
5 | 5 | '\n'
|
|
461 | 461 | '\n'
|
462 | 462 | ' async_for_stmt ::= "async" for_stmt\n'
|
463 | 463 | '\n'
|
464 |
| - 'An *asynchronous iterable* is able to call asynchronous code in ' |
465 |
| - 'its\n' |
466 |
| - '*iter* implementation, and *asynchronous iterator* can call\n' |
467 |
| - 'asynchronous code in its *next* method.\n' |
| 464 | + 'An *asynchronous iterable* provides an "__aiter__" method that\n' |
| 465 | + 'directly returns an *asynchronous iterator*, which can call\n' |
| 466 | + 'asynchronous code in its "__anext__" method.\n' |
468 | 467 | '\n'
|
469 | 468 | 'The "async for" statement allows convenient iteration over\n'
|
470 |
| - 'asynchronous iterators.\n' |
| 469 | + 'asynchronous iterables.\n' |
471 | 470 | '\n'
|
472 | 471 | 'The following code:\n'
|
473 | 472 | '\n'
|
|
2383 | 2382 | 'compatible\n'
|
2384 | 2383 | 'with an exception if it is the class or a base class of the '
|
2385 | 2384 | 'exception\n'
|
2386 |
| - 'object or a tuple containing an item compatible with the ' |
2387 |
| - 'exception.\n' |
| 2385 | + 'object, or a tuple containing an item that is the class or a ' |
| 2386 | + 'base\n' |
| 2387 | + 'class of the exception object.\n' |
2388 | 2388 | '\n'
|
2389 | 2389 | 'If no except clause matches the exception, the search for an '
|
2390 | 2390 | 'exception\n'
|
|
2451 | 2451 | '(see\n'
|
2452 | 2452 | 'section The standard type hierarchy) identifying the point in '
|
2453 | 2453 | 'the\n'
|
2454 |
| - 'program where the exception occurred. "sys.exc_info()" values ' |
2455 |
| - 'are\n' |
2456 |
| - 'restored to their previous values (before the call) when ' |
2457 |
| - 'returning\n' |
2458 |
| - 'from a function that handled an exception.\n' |
| 2454 | + 'program where the exception occurred. The details about the ' |
| 2455 | + 'exception\n' |
| 2456 | + 'accessed via "sys.exc_info()" are restored to their previous ' |
| 2457 | + 'values\n' |
| 2458 | + 'when leaving an exception handler:\n' |
| 2459 | + '\n' |
| 2460 | + ' >>> print(sys.exc_info())\n' |
| 2461 | + ' (None, None, None)\n' |
| 2462 | + ' >>> try:\n' |
| 2463 | + ' ... raise TypeError\n' |
| 2464 | + ' ... except:\n' |
| 2465 | + ' ... print(sys.exc_info())\n' |
| 2466 | + ' ... try:\n' |
| 2467 | + ' ... raise ValueError\n' |
| 2468 | + ' ... except:\n' |
| 2469 | + ' ... print(sys.exc_info())\n' |
| 2470 | + ' ... print(sys.exc_info())\n' |
| 2471 | + ' ...\n' |
| 2472 | + " (<class 'TypeError'>, TypeError(), <traceback object at " |
| 2473 | + '0x10efad080>)\n' |
| 2474 | + " (<class 'ValueError'>, ValueError(), <traceback object at " |
| 2475 | + '0x10efad040>)\n' |
| 2476 | + " (<class 'TypeError'>, TypeError(), <traceback object at " |
| 2477 | + '0x10efad080>)\n' |
| 2478 | + ' >>> print(sys.exc_info())\n' |
| 2479 | + ' (None, None, None)\n' |
2459 | 2480 | '\n'
|
2460 | 2481 | 'The optional "else" clause is executed if the control flow '
|
2461 | 2482 | 'leaves the\n'
|
|
2985 | 3006 | '\n'
|
2986 | 3007 | ' async_for_stmt ::= "async" for_stmt\n'
|
2987 | 3008 | '\n'
|
2988 |
| - 'An *asynchronous iterable* is able to call asynchronous code in ' |
2989 |
| - 'its\n' |
2990 |
| - '*iter* implementation, and *asynchronous iterator* can call\n' |
2991 |
| - 'asynchronous code in its *next* method.\n' |
| 3009 | + 'An *asynchronous iterable* provides an "__aiter__" method that\n' |
| 3010 | + 'directly returns an *asynchronous iterator*, which can call\n' |
| 3011 | + 'asynchronous code in its "__anext__" method.\n' |
2992 | 3012 | '\n'
|
2993 | 3013 | 'The "async for" statement allows convenient iteration over\n'
|
2994 |
| - 'asynchronous iterators.\n' |
| 3014 | + 'asynchronous iterables.\n' |
2995 | 3015 | '\n'
|
2996 | 3016 | 'The following code:\n'
|
2997 | 3017 | '\n'
|
|
5524 | 5544 | ' | | formats the result in either fixed-point '
|
5525 | 5545 | 'format or in |\n'
|
5526 | 5546 | ' | | scientific notation, depending on its '
|
5527 |
| - 'magnitude. The |\n' |
5528 |
| - ' | | precise rules are as follows: suppose that ' |
5529 |
| - 'the result |\n' |
| 5547 | + 'magnitude. A |\n' |
| 5548 | + ' | | precision of "0" is treated as equivalent ' |
| 5549 | + 'to a precision |\n' |
| 5550 | + ' | | of "1". The precise rules are as follows: ' |
| 5551 | + 'suppose that |\n' |
| 5552 | + ' | | the result formatted with presentation ' |
| 5553 | + 'type "\'e\'" and |\n' |
| 5554 | + ' | | precision "p-1" would have exponent ' |
| 5555 | + '"exp". Then, if "m <= |\n' |
| 5556 | + ' | | exp < p", where "m" is -4 for floats and ' |
| 5557 | + '-6 for |\n' |
| 5558 | + ' | | "Decimals", the number is formatted with ' |
| 5559 | + 'presentation type |\n' |
| 5560 | + ' | | "\'f\'" and precision "p-1-exp". ' |
| 5561 | + 'Otherwise, the number is |\n' |
5530 | 5562 | ' | | formatted with presentation type "\'e\'" '
|
5531 |
| - 'and precision "p-1" |\n' |
5532 |
| - ' | | would have exponent "exp". Then, if "m <= ' |
5533 |
| - 'exp < p", where |\n' |
5534 |
| - ' | | "m" is -4 for floats and -6 for ' |
5535 |
| - '"Decimals", the number is |\n' |
5536 |
| - ' | | formatted with presentation type "\'f\'" ' |
5537 | 5563 | 'and precision |\n'
|
5538 |
| - ' | | "p-1-exp". Otherwise, the number is ' |
5539 |
| - 'formatted with |\n' |
5540 |
| - ' | | presentation type "\'e\'" and precision ' |
5541 |
| - '"p-1". In both cases |\n' |
5542 |
| - ' | | insignificant trailing zeros are removed ' |
5543 |
| - 'from the |\n' |
5544 |
| - ' | | significand, and the decimal point is also ' |
5545 |
| - 'removed if |\n' |
5546 |
| - ' | | there are no remaining digits following ' |
5547 |
| - 'it, unless the |\n' |
5548 |
| - ' | | "\'#\'" option is used. Positive and ' |
5549 |
| - 'negative infinity, |\n' |
5550 |
| - ' | | positive and negative zero, and nans, are ' |
5551 |
| - 'formatted as |\n' |
5552 |
| - ' | | "inf", "-inf", "0", "-0" and "nan" ' |
5553 |
| - 'respectively, |\n' |
5554 |
| - ' | | regardless of the precision. A precision ' |
5555 |
| - 'of "0" is |\n' |
5556 |
| - ' | | treated as equivalent to a precision of ' |
5557 |
| - '"1". With no |\n' |
5558 |
| - ' | | precision given, uses a precision of "6" ' |
5559 |
| - 'significant |\n' |
5560 |
| - ' | | digits for "float", and shows all ' |
5561 |
| - 'coefficient digits for |\n' |
5562 |
| - ' | | ' |
5563 |
| - '"Decimal". ' |
5564 |
| - '|\n' |
| 5564 | + ' | | "p-1". In both cases insignificant ' |
| 5565 | + 'trailing zeros are |\n' |
| 5566 | + ' | | removed from the significand, and the ' |
| 5567 | + 'decimal point is |\n' |
| 5568 | + ' | | also removed if there are no remaining ' |
| 5569 | + 'digits following |\n' |
| 5570 | + ' | | it, unless the "\'#\'" option is used. ' |
| 5571 | + 'With no precision |\n' |
| 5572 | + ' | | given, uses a precision of "6" significant ' |
| 5573 | + 'digits for |\n' |
| 5574 | + ' | | "float". For "Decimal", the coefficient of ' |
| 5575 | + 'the result is |\n' |
| 5576 | + ' | | formed from the coefficient digits of the ' |
| 5577 | + 'value; |\n' |
| 5578 | + ' | | scientific notation is used for values ' |
| 5579 | + 'smaller than "1e-6" |\n' |
| 5580 | + ' | | in absolute value and values where the ' |
| 5581 | + 'place value of the |\n' |
| 5582 | + ' | | least significant digit is larger than 1, ' |
| 5583 | + 'and fixed-point |\n' |
| 5584 | + ' | | notation is used otherwise. Positive and ' |
| 5585 | + 'negative |\n' |
| 5586 | + ' | | infinity, positive and negative zero, and ' |
| 5587 | + 'nans, are |\n' |
| 5588 | + ' | | formatted as "inf", "-inf", "0", "-0" and ' |
| 5589 | + '"nan" |\n' |
| 5590 | + ' | | respectively, regardless of the ' |
| 5591 | + 'precision. |\n' |
5565 | 5592 | ' '
|
5566 | 5593 | '+-----------+------------------------------------------------------------+\n'
|
5567 | 5594 | ' | "\'G\'" | General format. Same as "\'g\'" except '
|
|
5586 | 5613 | 'percent sign. |\n'
|
5587 | 5614 | ' '
|
5588 | 5615 | '+-----------+------------------------------------------------------------+\n'
|
5589 |
| - ' | None | Similar to "\'g\'", except that ' |
5590 |
| - 'fixed-point notation, when |\n' |
5591 |
| - ' | | used, has at least one digit past the ' |
5592 |
| - 'decimal point. The |\n' |
5593 |
| - ' | | default precision is as high as needed to ' |
5594 |
| - 'represent the |\n' |
5595 |
| - ' | | particular value. The overall effect is to ' |
5596 |
| - 'match the |\n' |
5597 |
| - ' | | output of "str()" as altered by the other ' |
5598 |
| - 'format |\n' |
5599 |
| - ' | | ' |
5600 |
| - 'modifiers. ' |
5601 |
| - '|\n' |
| 5616 | + ' | None | For "float" this is the same as "\'g\'", ' |
| 5617 | + 'except that when |\n' |
| 5618 | + ' | | fixed-point notation is used to format the ' |
| 5619 | + 'result, it |\n' |
| 5620 | + ' | | always includes at least one digit past ' |
| 5621 | + 'the decimal point. |\n' |
| 5622 | + ' | | The precision used is as large as needed ' |
| 5623 | + 'to represent the |\n' |
| 5624 | + ' | | given value faithfully. For "Decimal", ' |
| 5625 | + 'this is the same |\n' |
| 5626 | + ' | | as either "\'g\'" or "\'G\'" depending on ' |
| 5627 | + 'the value of |\n' |
| 5628 | + ' | | "context.capitals" for the current decimal ' |
| 5629 | + 'context. The |\n' |
| 5630 | + ' | | overall effect is to match the output of ' |
| 5631 | + '"str()" as |\n' |
| 5632 | + ' | | altered by the other format ' |
| 5633 | + 'modifiers. |\n' |
5602 | 5634 | ' '
|
5603 | 5635 | '+-----------+------------------------------------------------------------+\n'
|
5604 | 5636 | '\n'
|
|
5972 | 6004 | '\n'
|
5973 | 6005 | 'Names listed in a "global" statement must not be defined as '
|
5974 | 6006 | 'formal\n'
|
5975 |
| - 'parameters or in a "for" loop control target, "class" definition,\n' |
5976 |
| - 'function definition, "import" statement, or variable annotation.\n' |
| 6007 | + 'parameters, or as targets in "with" statements or "except" ' |
| 6008 | + 'clauses, or\n' |
| 6009 | + 'in a "for" target list, "class" definition, function definition,\n' |
| 6010 | + '"import" statement, or variable annotation.\n' |
5977 | 6011 | '\n'
|
5978 | 6012 | '**CPython implementation detail:** The current implementation does '
|
5979 | 6013 | 'not\n'
|
|
7925 | 7959 | 'immediate\n'
|
7926 | 7960 | ' subclasses. This method returns a list of all those '
|
7927 | 7961 | 'references\n'
|
7928 |
| - ' still alive. Example:\n' |
| 7962 | + ' still alive. The list is in definition order. Example:\n' |
7929 | 7963 | '\n'
|
7930 | 7964 | ' >>> int.__subclasses__()\n'
|
7931 | 7965 | " [<class 'bool'>]\n"
|
|
11224 | 11258 | 'object is “compatible” with the exception. An object is compatible\n'
|
11225 | 11259 | 'with an exception if it is the class or a base class of the '
|
11226 | 11260 | 'exception\n'
|
11227 |
| - 'object or a tuple containing an item compatible with the exception.\n' |
| 11261 | + 'object, or a tuple containing an item that is the class or a base\n' |
| 11262 | + 'class of the exception object.\n' |
11228 | 11263 | '\n'
|
11229 | 11264 | 'If no except clause matches the exception, the search for an '
|
11230 | 11265 | 'exception\n'
|
|
11279 | 11314 | 'the\n'
|
11280 | 11315 | 'exception class, the exception instance and a traceback object (see\n'
|
11281 | 11316 | 'section The standard type hierarchy) identifying the point in the\n'
|
11282 |
| - 'program where the exception occurred. "sys.exc_info()" values are\n' |
11283 |
| - 'restored to their previous values (before the call) when returning\n' |
11284 |
| - 'from a function that handled an exception.\n' |
| 11317 | + 'program where the exception occurred. The details about the ' |
| 11318 | + 'exception\n' |
| 11319 | + 'accessed via "sys.exc_info()" are restored to their previous values\n' |
| 11320 | + 'when leaving an exception handler:\n' |
| 11321 | + '\n' |
| 11322 | + ' >>> print(sys.exc_info())\n' |
| 11323 | + ' (None, None, None)\n' |
| 11324 | + ' >>> try:\n' |
| 11325 | + ' ... raise TypeError\n' |
| 11326 | + ' ... except:\n' |
| 11327 | + ' ... print(sys.exc_info())\n' |
| 11328 | + ' ... try:\n' |
| 11329 | + ' ... raise ValueError\n' |
| 11330 | + ' ... except:\n' |
| 11331 | + ' ... print(sys.exc_info())\n' |
| 11332 | + ' ... print(sys.exc_info())\n' |
| 11333 | + ' ...\n' |
| 11334 | + " (<class 'TypeError'>, TypeError(), <traceback object at " |
| 11335 | + '0x10efad080>)\n' |
| 11336 | + " (<class 'ValueError'>, ValueError(), <traceback object at " |
| 11337 | + '0x10efad040>)\n' |
| 11338 | + " (<class 'TypeError'>, TypeError(), <traceback object at " |
| 11339 | + '0x10efad080>)\n' |
| 11340 | + ' >>> print(sys.exc_info())\n' |
| 11341 | + ' (None, None, None)\n' |
11285 | 11342 | '\n'
|
11286 | 11343 | 'The optional "else" clause is executed if the control flow leaves '
|
11287 | 11344 | 'the\n'
|
|
11445 | 11502 | ' There are two types of integers:\n'
|
11446 | 11503 | '\n'
|
11447 | 11504 | ' Integers ("int")\n'
|
11448 |
| - '\n' |
11449 | 11505 | ' These represent numbers in an unlimited range, subject to\n'
|
11450 | 11506 | ' available (virtual) memory only. For the purpose of '
|
11451 | 11507 | 'shift\n'
|
|
0 commit comments