mirror of
https://github.com/python/cpython.git
synced 2025-08-24 02:35:59 +00:00
Python 3.9.0a1
This commit is contained in:
parent
24555ce2f9
commit
fd757083df
573 changed files with 6113 additions and 1382 deletions
|
@ -1,5 +1,5 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
# Autogenerated by Sphinx on Tue Jun 4 19:40:37 2019
|
||||
# Autogenerated by Sphinx on Tue Nov 19 11:42:25 2019
|
||||
topics = {'assert': 'The "assert" statement\n'
|
||||
'**********************\n'
|
||||
'\n'
|
||||
|
@ -744,10 +744,11 @@ topics = {'assert': 'The "assert" statement\n'
|
|||
'returned.\n'
|
||||
'\n'
|
||||
'The "__dir__" function should accept no arguments, and '
|
||||
'return a list\n'
|
||||
'of strings that represents the names accessible on '
|
||||
'module. If present,\n'
|
||||
'this function overrides the standard "dir()" search on a '
|
||||
'return a\n'
|
||||
'sequence of strings that represents the names accessible '
|
||||
'on module. If\n'
|
||||
'present, this function overrides the standard "dir()" '
|
||||
'search on a\n'
|
||||
'module.\n'
|
||||
'\n'
|
||||
'For a more fine grained customization of the module '
|
||||
|
@ -808,21 +809,34 @@ topics = {'assert': 'The "assert" statement\n'
|
|||
'whose name is\n'
|
||||
'the key of the property in the owner class’ "__dict__".\n'
|
||||
'\n'
|
||||
'object.__get__(self, instance, owner)\n'
|
||||
'object.__get__(self, instance, owner=None)\n'
|
||||
'\n'
|
||||
' Called to get the attribute of the owner class (class '
|
||||
'attribute\n'
|
||||
' access) or of an instance of that class (instance '
|
||||
'attribute\n'
|
||||
' access). *owner* is always the owner class, while '
|
||||
'*instance* is the\n'
|
||||
' instance that the attribute was accessed through, or '
|
||||
'"None" when\n'
|
||||
' the attribute is accessed through the *owner*. This '
|
||||
'method should\n'
|
||||
' return the (computed) attribute value or raise an '
|
||||
'"AttributeError"\n'
|
||||
' exception.\n'
|
||||
' access). The optional *owner* argument is the owner '
|
||||
'class, while\n'
|
||||
' *instance* is the instance that the attribute was '
|
||||
'accessed through,\n'
|
||||
' or "None" when the attribute is accessed through the '
|
||||
'*owner*.\n'
|
||||
'\n'
|
||||
' This method should return the computed attribute '
|
||||
'value or raise an\n'
|
||||
' "AttributeError" exception.\n'
|
||||
'\n'
|
||||
' **PEP 252** specifies that "__get__()" is callable '
|
||||
'with one or two\n'
|
||||
' arguments. Python’s own built-in descriptors support '
|
||||
'this\n'
|
||||
' specification; however, it is likely that some '
|
||||
'third-party tools\n'
|
||||
' have descriptors that require both arguments. '
|
||||
'Python’s own\n'
|
||||
' "__getattribute__()" implementation always passes in '
|
||||
'both arguments\n'
|
||||
' whether they are required or not.\n'
|
||||
'\n'
|
||||
'object.__set__(self, instance, value)\n'
|
||||
'\n'
|
||||
|
@ -830,6 +844,12 @@ topics = {'assert': 'The "assert" statement\n'
|
|||
'of the owner\n'
|
||||
' class to a new value, *value*.\n'
|
||||
'\n'
|
||||
' Note, adding "__set__()" or "__delete__()" changes '
|
||||
'the kind of\n'
|
||||
' descriptor to a “data descriptor”. See Invoking '
|
||||
'Descriptors for\n'
|
||||
' more details.\n'
|
||||
'\n'
|
||||
'object.__delete__(self, instance)\n'
|
||||
'\n'
|
||||
' Called to delete the attribute on an instance '
|
||||
|
@ -938,12 +958,13 @@ topics = {'assert': 'The "assert" statement\n'
|
|||
'define both\n'
|
||||
'"__get__()" and "__set__()", while non-data descriptors '
|
||||
'have just the\n'
|
||||
'"__get__()" method. Data descriptors with "__set__()" '
|
||||
'and "__get__()"\n'
|
||||
'defined always override a redefinition in an instance '
|
||||
'dictionary. In\n'
|
||||
'contrast, non-data descriptors can be overridden by '
|
||||
'instances.\n'
|
||||
'"__get__()" method. Data descriptors with "__get__()" '
|
||||
'and "__set__()"\n'
|
||||
'(and/or "__delete__()") defined always override a '
|
||||
'redefinition in an\n'
|
||||
'instance dictionary. In contrast, non-data descriptors '
|
||||
'can be\n'
|
||||
'overridden by instances.\n'
|
||||
'\n'
|
||||
'Python methods (including "staticmethod()" and '
|
||||
'"classmethod()") are\n'
|
||||
|
@ -1070,7 +1091,13 @@ topics = {'assert': 'The "assert" statement\n'
|
|||
'attributes created by\n'
|
||||
' slots (the other bases must have empty slot layouts) - '
|
||||
'violations\n'
|
||||
' raise "TypeError".\n',
|
||||
' raise "TypeError".\n'
|
||||
'\n'
|
||||
'* If an iterator is used for *__slots__* then a '
|
||||
'descriptor is\n'
|
||||
' created for each of the iterator’s values. However, '
|
||||
'the *__slots__*\n'
|
||||
' attribute will be an empty iterator.\n',
|
||||
'attribute-references': 'Attribute references\n'
|
||||
'********************\n'
|
||||
'\n'
|
||||
|
@ -1829,6 +1856,12 @@ topics = {'assert': 'The "assert" statement\n'
|
|||
'all false.\n'
|
||||
' This behavior is compliant with IEEE 754.\n'
|
||||
'\n'
|
||||
'* "None" and "NotImplemented" are singletons. **PEP 8** '
|
||||
'advises\n'
|
||||
' that comparisons for singletons should always be done with '
|
||||
'"is" or\n'
|
||||
' "is not", never the equality operators.\n'
|
||||
'\n'
|
||||
'* Binary sequences (instances of "bytes" or "bytearray") can '
|
||||
'be\n'
|
||||
' compared within and across their types. They compare\n'
|
||||
|
@ -1854,38 +1887,13 @@ topics = {'assert': 'The "assert" statement\n'
|
|||
' these types raises "TypeError".\n'
|
||||
'\n'
|
||||
' Sequences compare lexicographically using comparison of\n'
|
||||
' corresponding elements, whereby reflexivity of the elements '
|
||||
'is\n'
|
||||
' enforced.\n'
|
||||
'\n'
|
||||
' In enforcing reflexivity of elements, the comparison of '
|
||||
'collections\n'
|
||||
' assumes that for a collection element "x", "x == x" is '
|
||||
'always true.\n'
|
||||
' Based on that assumption, element identity is compared '
|
||||
'first, and\n'
|
||||
' element comparison is performed only for distinct '
|
||||
'elements. This\n'
|
||||
' approach yields the same result as a strict element '
|
||||
'comparison\n'
|
||||
' would, if the compared elements are reflexive. For '
|
||||
'non-reflexive\n'
|
||||
' elements, the result is different than for strict element\n'
|
||||
' comparison, and may be surprising: The non-reflexive '
|
||||
'not-a-number\n'
|
||||
' values for example result in the following comparison '
|
||||
'behavior when\n'
|
||||
' used in a list:\n'
|
||||
'\n'
|
||||
" >>> nan = float('NaN')\n"
|
||||
' >>> nan is nan\n'
|
||||
' True\n'
|
||||
' >>> nan == nan\n'
|
||||
' False <-- the defined non-reflexive '
|
||||
'behavior of NaN\n'
|
||||
' >>> [nan] == [nan]\n'
|
||||
' True <-- list enforces reflexivity and '
|
||||
'tests identity first\n'
|
||||
' corresponding elements. The built-in containers typically '
|
||||
'assume\n'
|
||||
' identical objects are equal to themselves. That lets them '
|
||||
'bypass\n'
|
||||
' equality tests for identical objects to improve performance '
|
||||
'and to\n'
|
||||
' maintain their internal invariants.\n'
|
||||
'\n'
|
||||
' Lexicographical comparison between built-in collections '
|
||||
'works as\n'
|
||||
|
@ -3126,13 +3134,15 @@ topics = {'assert': 'The "assert" statement\n'
|
|||
'returning\n'
|
||||
' it.\n'
|
||||
'\n'
|
||||
' If "__new__()" returns an instance of *cls*, then the '
|
||||
'new\n'
|
||||
' instance’s "__init__()" method will be invoked like\n'
|
||||
' "__init__(self[, ...])", where *self* is the new '
|
||||
'instance and the\n'
|
||||
' remaining arguments are the same as were passed to '
|
||||
'"__new__()".\n'
|
||||
' If "__new__()" is invoked during object construction and '
|
||||
'it returns\n'
|
||||
' an instance or subclass of *cls*, then the new '
|
||||
'instance’s\n'
|
||||
' "__init__()" method will be invoked like '
|
||||
'"__init__(self[, ...])",\n'
|
||||
' where *self* is the new instance and the remaining '
|
||||
'arguments are\n'
|
||||
' the same as were passed to the object constructor.\n'
|
||||
'\n'
|
||||
' If "__new__()" does not return an instance of *cls*, '
|
||||
'then the new\n'
|
||||
|
@ -3500,10 +3510,10 @@ topics = {'assert': 'The "assert" statement\n'
|
|||
' hashable by an "isinstance(obj, '
|
||||
'collections.abc.Hashable)" call.\n'
|
||||
'\n'
|
||||
' Note: By default, the "__hash__()" values of str, bytes '
|
||||
'and\n'
|
||||
' datetime objects are “salted” with an unpredictable '
|
||||
'random value.\n'
|
||||
' Note: By default, the "__hash__()" values of str and '
|
||||
'bytes\n'
|
||||
' objects are “salted” with an unpredictable random '
|
||||
'value.\n'
|
||||
' Although they remain constant within an individual '
|
||||
'Python\n'
|
||||
' process, they are not predictable between repeated '
|
||||
|
@ -3758,6 +3768,8 @@ topics = {'assert': 'The "assert" statement\n'
|
|||
'\n'
|
||||
" import pdb; pdb.Pdb(skip=['django.*']).set_trace()\n"
|
||||
'\n'
|
||||
' Raises an auditing event "pdb.Pdb" with no arguments.\n'
|
||||
'\n'
|
||||
' New in version 3.1: The *skip* argument.\n'
|
||||
'\n'
|
||||
' New in version 3.2: The *nosigint* argument. Previously, a '
|
||||
|
@ -4289,7 +4301,14 @@ topics = {'assert': 'The "assert" statement\n'
|
|||
'section The standard type hierarchy. (To summarize, the key type\n'
|
||||
'should be *hashable*, which excludes all mutable objects.) Clashes\n'
|
||||
'between duplicate keys are not detected; the last datum (textually\n'
|
||||
'rightmost in the display) stored for a given key value prevails.\n',
|
||||
'rightmost in the display) stored for a given key value prevails.\n'
|
||||
'\n'
|
||||
'Changed in version 3.8: Prior to Python 3.8, in dict '
|
||||
'comprehensions,\n'
|
||||
'the evaluation order of key and value was not well-defined. In\n'
|
||||
'CPython, the value was evaluated before the key. Starting with '
|
||||
'3.8,\n'
|
||||
'the key is evaluated before the value, as proposed by **PEP 572**.\n',
|
||||
'dynamic-features': 'Interaction with dynamic features\n'
|
||||
'*********************************\n'
|
||||
'\n'
|
||||
|
@ -4430,9 +4449,13 @@ topics = {'assert': 'The "assert" statement\n'
|
|||
'(a\n'
|
||||
'command specified on the interpreter command line with the '
|
||||
'"-c"\n'
|
||||
'option) is a code block. The string argument passed to the '
|
||||
'built-in\n'
|
||||
'functions "eval()" and "exec()" is a code block.\n'
|
||||
'option) is a code block. A module run as a top level script (as '
|
||||
'module\n'
|
||||
'"__main__") from the command line using a "-m" argument is also '
|
||||
'a code\n'
|
||||
'block. The string argument passed to the built-in functions '
|
||||
'"eval()"\n'
|
||||
'and "exec()" is a code block.\n'
|
||||
'\n'
|
||||
'A code block is executed in an *execution frame*. A frame '
|
||||
'contains\n'
|
||||
|
@ -5090,7 +5113,7 @@ topics = {'assert': 'The "assert" statement\n'
|
|||
'Meaning '
|
||||
'|\n'
|
||||
' '
|
||||
'+===========+============================================================+\n'
|
||||
'|===========|============================================================|\n'
|
||||
' | "\'<\'" | Forces the field to be left-aligned '
|
||||
'within the available |\n'
|
||||
' | | space (this is the default for most '
|
||||
|
@ -5139,7 +5162,7 @@ topics = {'assert': 'The "assert" statement\n'
|
|||
'Meaning '
|
||||
'|\n'
|
||||
' '
|
||||
'+===========+============================================================+\n'
|
||||
'|===========|============================================================|\n'
|
||||
' | "\'+\'" | indicates that a sign should be used for '
|
||||
'both positive as |\n'
|
||||
' | | well as negative '
|
||||
|
@ -5243,7 +5266,7 @@ topics = {'assert': 'The "assert" statement\n'
|
|||
'Meaning '
|
||||
'|\n'
|
||||
' '
|
||||
'+===========+============================================================+\n'
|
||||
'|===========|============================================================|\n'
|
||||
' | "\'s\'" | String format. This is the default type '
|
||||
'for strings and |\n'
|
||||
' | | may be '
|
||||
|
@ -5263,7 +5286,7 @@ topics = {'assert': 'The "assert" statement\n'
|
|||
'Meaning '
|
||||
'|\n'
|
||||
' '
|
||||
'+===========+============================================================+\n'
|
||||
'|===========|============================================================|\n'
|
||||
' | "\'b\'" | Binary format. Outputs the number in '
|
||||
'base 2. |\n'
|
||||
' '
|
||||
|
@ -5325,7 +5348,7 @@ topics = {'assert': 'The "assert" statement\n'
|
|||
'Meaning '
|
||||
'|\n'
|
||||
' '
|
||||
'+===========+============================================================+\n'
|
||||
'|===========|============================================================|\n'
|
||||
' | "\'e\'" | Exponent notation. Prints the number in '
|
||||
'scientific |\n'
|
||||
' | | notation using the letter ‘e’ to indicate '
|
||||
|
@ -5364,30 +5387,34 @@ topics = {'assert': 'The "assert" statement\n'
|
|||
'the result |\n'
|
||||
' | | formatted with presentation type "\'e\'" '
|
||||
'and precision "p-1" |\n'
|
||||
' | | would have exponent "exp". Then if "-4 <= '
|
||||
'exp < p", the |\n'
|
||||
' | | number is formatted with presentation type '
|
||||
'"\'f\'" and |\n'
|
||||
' | | precision "p-1-exp". Otherwise, the '
|
||||
'number is formatted |\n'
|
||||
' | | with presentation type "\'e\'" and '
|
||||
'precision "p-1". In both |\n'
|
||||
' | | cases insignificant trailing zeros are '
|
||||
'removed from the |\n'
|
||||
' | | would have exponent "exp". Then, if "m <= '
|
||||
'exp < p", where |\n'
|
||||
' | | "m" is -4 for floats and -6 for '
|
||||
'"Decimals", the number is |\n'
|
||||
' | | formatted with presentation type "\'f\'" '
|
||||
'and precision |\n'
|
||||
' | | "p-1-exp". Otherwise, the number is '
|
||||
'formatted with |\n'
|
||||
' | | presentation type "\'e\'" and precision '
|
||||
'"p-1". In both cases |\n'
|
||||
' | | insignificant trailing zeros are removed '
|
||||
'from the |\n'
|
||||
' | | significand, and the decimal point is also '
|
||||
'removed if |\n'
|
||||
' | | there are no remaining digits following '
|
||||
'it. Positive and |\n'
|
||||
' | | negative infinity, positive and negative '
|
||||
'zero, and nans, |\n'
|
||||
' | | are formatted as "inf", "-inf", "0", "-0" '
|
||||
'and "nan" |\n'
|
||||
' | | respectively, regardless of the '
|
||||
'precision. A precision of |\n'
|
||||
' | | "0" is treated as equivalent to a '
|
||||
'precision of "1". The |\n'
|
||||
' | | default precision is '
|
||||
'"6". |\n'
|
||||
'it, unless the |\n'
|
||||
' | | "\'#\'" option is used. Positive and '
|
||||
'negative infinity, |\n'
|
||||
' | | positive and negative zero, and nans, are '
|
||||
'formatted as |\n'
|
||||
' | | "inf", "-inf", "0", "-0" and "nan" '
|
||||
'respectively, |\n'
|
||||
' | | regardless of the precision. A precision '
|
||||
'of "0" is |\n'
|
||||
' | | treated as equivalent to a precision of '
|
||||
'"1". The default |\n'
|
||||
' | | precision is '
|
||||
'"6". |\n'
|
||||
' '
|
||||
'+-----------+------------------------------------------------------------+\n'
|
||||
' | "\'G\'" | General format. Same as "\'g\'" except '
|
||||
|
@ -6212,6 +6239,10 @@ topics = {'assert': 'The "assert" statement\n'
|
|||
'that\n'
|
||||
'determine dynamically the modules to be loaded.\n'
|
||||
'\n'
|
||||
'Raises an auditing event "import" with arguments "module", '
|
||||
'"filename",\n'
|
||||
'"sys.path", "sys.meta_path", "sys.path_hooks".\n'
|
||||
'\n'
|
||||
'\n'
|
||||
'Future statements\n'
|
||||
'=================\n'
|
||||
|
@ -7036,7 +7067,10 @@ topics = {'assert': 'The "assert" statement\n'
|
|||
'+-------------------------------------------------+---------------------------------------+\n'
|
||||
'| Operator | '
|
||||
'Description |\n'
|
||||
'+=================================================+=======================================+\n'
|
||||
'|=================================================|=======================================|\n'
|
||||
'| ":=" | '
|
||||
'Assignment expression |\n'
|
||||
'+-------------------------------------------------+---------------------------------------+\n'
|
||||
'| "lambda" | '
|
||||
'Lambda expression |\n'
|
||||
'+-------------------------------------------------+---------------------------------------+\n'
|
||||
|
@ -7093,10 +7127,10 @@ topics = {'assert': 'The "assert" statement\n'
|
|||
'| "x(arguments...)", "x.attribute" | '
|
||||
'attribute reference |\n'
|
||||
'+-------------------------------------------------+---------------------------------------+\n'
|
||||
'| "(expressions...)", "[expressions...]", "{key: | '
|
||||
'Binding or tuple display, list |\n'
|
||||
'| value...}", "{expressions...}" | '
|
||||
'display, dictionary display, set |\n'
|
||||
'| "(expressions...)", "[expressions...]", "{key: | '
|
||||
'Binding or parenthesized expression, |\n'
|
||||
'| value...}", "{expressions...}" | list '
|
||||
'display, dictionary display, set |\n'
|
||||
'| | '
|
||||
'display |\n'
|
||||
'+-------------------------------------------------+---------------------------------------+\n'
|
||||
|
@ -7432,9 +7466,9 @@ topics = {'assert': 'The "assert" statement\n'
|
|||
'to allow\n'
|
||||
'efficient iteration through the container; for mappings, '
|
||||
'"__iter__()"\n'
|
||||
'should be the same as "keys()"; for sequences, it should '
|
||||
'iterate\n'
|
||||
'through the values.\n'
|
||||
'should iterate through the object’s keys; for sequences, '
|
||||
'it should\n'
|
||||
'iterate through the values.\n'
|
||||
'\n'
|
||||
'object.__len__(self)\n'
|
||||
'\n'
|
||||
|
@ -7464,7 +7498,11 @@ topics = {'assert': 'The "assert" statement\n'
|
|||
' estimated length for the object (which may be greater '
|
||||
'or less than\n'
|
||||
' the actual length). The length must be an integer ">=" '
|
||||
'0. This\n'
|
||||
'0. The\n'
|
||||
' return value may also be "NotImplemented", which is '
|
||||
'treated the\n'
|
||||
' same as if the "__length_hint__" method didn’t exist at '
|
||||
'all. This\n'
|
||||
' method is purely an optimization and is never required '
|
||||
'for\n'
|
||||
' correctness.\n'
|
||||
|
@ -7582,12 +7620,12 @@ topics = {'assert': 'The "assert" statement\n'
|
|||
'\n'
|
||||
'The membership test operators ("in" and "not in") are '
|
||||
'normally\n'
|
||||
'implemented as an iteration through a sequence. However, '
|
||||
'implemented as an iteration through a container. However, '
|
||||
'container\n'
|
||||
'objects can supply the following special method with a '
|
||||
'more efficient\n'
|
||||
'implementation, which also does not require the object be '
|
||||
'a sequence.\n'
|
||||
'iterable.\n'
|
||||
'\n'
|
||||
'object.__contains__(self, item)\n'
|
||||
'\n'
|
||||
|
@ -7832,13 +7870,15 @@ topics = {'assert': 'The "assert" statement\n'
|
|||
'returning\n'
|
||||
' it.\n'
|
||||
'\n'
|
||||
' If "__new__()" returns an instance of *cls*, then the '
|
||||
'new\n'
|
||||
' instance’s "__init__()" method will be invoked like\n'
|
||||
' "__init__(self[, ...])", where *self* is the new instance '
|
||||
'and the\n'
|
||||
' remaining arguments are the same as were passed to '
|
||||
'"__new__()".\n'
|
||||
' If "__new__()" is invoked during object construction and '
|
||||
'it returns\n'
|
||||
' an instance or subclass of *cls*, then the new '
|
||||
'instance’s\n'
|
||||
' "__init__()" method will be invoked like "__init__(self[, '
|
||||
'...])",\n'
|
||||
' where *self* is the new instance and the remaining '
|
||||
'arguments are\n'
|
||||
' the same as were passed to the object constructor.\n'
|
||||
'\n'
|
||||
' If "__new__()" does not return an instance of *cls*, then '
|
||||
'the new\n'
|
||||
|
@ -8203,10 +8243,10 @@ topics = {'assert': 'The "assert" statement\n'
|
|||
' hashable by an "isinstance(obj, '
|
||||
'collections.abc.Hashable)" call.\n'
|
||||
'\n'
|
||||
' Note: By default, the "__hash__()" values of str, bytes '
|
||||
'and\n'
|
||||
' datetime objects are “salted” with an unpredictable '
|
||||
'random value.\n'
|
||||
' Note: By default, the "__hash__()" values of str and '
|
||||
'bytes\n'
|
||||
' objects are “salted” with an unpredictable random '
|
||||
'value.\n'
|
||||
' Although they remain constant within an individual '
|
||||
'Python\n'
|
||||
' process, they are not predictable between repeated '
|
||||
|
@ -8367,10 +8407,11 @@ topics = {'assert': 'The "assert" statement\n'
|
|||
'returned.\n'
|
||||
'\n'
|
||||
'The "__dir__" function should accept no arguments, and '
|
||||
'return a list\n'
|
||||
'of strings that represents the names accessible on module. '
|
||||
'If present,\n'
|
||||
'this function overrides the standard "dir()" search on a '
|
||||
'return a\n'
|
||||
'sequence of strings that represents the names accessible on '
|
||||
'module. If\n'
|
||||
'present, this function overrides the standard "dir()" search '
|
||||
'on a\n'
|
||||
'module.\n'
|
||||
'\n'
|
||||
'For a more fine grained customization of the module behavior '
|
||||
|
@ -8431,21 +8472,34 @@ topics = {'assert': 'The "assert" statement\n'
|
|||
'whose name is\n'
|
||||
'the key of the property in the owner class’ "__dict__".\n'
|
||||
'\n'
|
||||
'object.__get__(self, instance, owner)\n'
|
||||
'object.__get__(self, instance, owner=None)\n'
|
||||
'\n'
|
||||
' Called to get the attribute of the owner class (class '
|
||||
'attribute\n'
|
||||
' access) or of an instance of that class (instance '
|
||||
'attribute\n'
|
||||
' access). *owner* is always the owner class, while '
|
||||
'*instance* is the\n'
|
||||
' instance that the attribute was accessed through, or '
|
||||
'"None" when\n'
|
||||
' the attribute is accessed through the *owner*. This '
|
||||
'method should\n'
|
||||
' return the (computed) attribute value or raise an '
|
||||
'"AttributeError"\n'
|
||||
' exception.\n'
|
||||
' access). The optional *owner* argument is the owner '
|
||||
'class, while\n'
|
||||
' *instance* is the instance that the attribute was '
|
||||
'accessed through,\n'
|
||||
' or "None" when the attribute is accessed through the '
|
||||
'*owner*.\n'
|
||||
'\n'
|
||||
' This method should return the computed attribute value or '
|
||||
'raise an\n'
|
||||
' "AttributeError" exception.\n'
|
||||
'\n'
|
||||
' **PEP 252** specifies that "__get__()" is callable with '
|
||||
'one or two\n'
|
||||
' arguments. Python’s own built-in descriptors support '
|
||||
'this\n'
|
||||
' specification; however, it is likely that some '
|
||||
'third-party tools\n'
|
||||
' have descriptors that require both arguments. Python’s '
|
||||
'own\n'
|
||||
' "__getattribute__()" implementation always passes in both '
|
||||
'arguments\n'
|
||||
' whether they are required or not.\n'
|
||||
'\n'
|
||||
'object.__set__(self, instance, value)\n'
|
||||
'\n'
|
||||
|
@ -8453,6 +8507,12 @@ topics = {'assert': 'The "assert" statement\n'
|
|||
'the owner\n'
|
||||
' class to a new value, *value*.\n'
|
||||
'\n'
|
||||
' Note, adding "__set__()" or "__delete__()" changes the '
|
||||
'kind of\n'
|
||||
' descriptor to a “data descriptor”. See Invoking '
|
||||
'Descriptors for\n'
|
||||
' more details.\n'
|
||||
'\n'
|
||||
'object.__delete__(self, instance)\n'
|
||||
'\n'
|
||||
' Called to delete the attribute on an instance *instance* '
|
||||
|
@ -8559,12 +8619,13 @@ topics = {'assert': 'The "assert" statement\n'
|
|||
'both\n'
|
||||
'"__get__()" and "__set__()", while non-data descriptors have '
|
||||
'just the\n'
|
||||
'"__get__()" method. Data descriptors with "__set__()" and '
|
||||
'"__get__()"\n'
|
||||
'defined always override a redefinition in an instance '
|
||||
'dictionary. In\n'
|
||||
'contrast, non-data descriptors can be overridden by '
|
||||
'instances.\n'
|
||||
'"__get__()" method. Data descriptors with "__get__()" and '
|
||||
'"__set__()"\n'
|
||||
'(and/or "__delete__()") defined always override a '
|
||||
'redefinition in an\n'
|
||||
'instance dictionary. In contrast, non-data descriptors can '
|
||||
'be\n'
|
||||
'overridden by instances.\n'
|
||||
'\n'
|
||||
'Python methods (including "staticmethod()" and '
|
||||
'"classmethod()") are\n'
|
||||
|
@ -8691,6 +8752,12 @@ topics = {'assert': 'The "assert" statement\n'
|
|||
'violations\n'
|
||||
' raise "TypeError".\n'
|
||||
'\n'
|
||||
'* If an iterator is used for *__slots__* then a descriptor '
|
||||
'is\n'
|
||||
' created for each of the iterator’s values. However, the '
|
||||
'*__slots__*\n'
|
||||
' attribute will be an empty iterator.\n'
|
||||
'\n'
|
||||
'\n'
|
||||
'Customizing class creation\n'
|
||||
'==========================\n'
|
||||
|
@ -9136,9 +9203,9 @@ topics = {'assert': 'The "assert" statement\n'
|
|||
'allow\n'
|
||||
'efficient iteration through the container; for mappings, '
|
||||
'"__iter__()"\n'
|
||||
'should be the same as "keys()"; for sequences, it should '
|
||||
'iterate\n'
|
||||
'through the values.\n'
|
||||
'should iterate through the object’s keys; for sequences, it '
|
||||
'should\n'
|
||||
'iterate through the values.\n'
|
||||
'\n'
|
||||
'object.__len__(self)\n'
|
||||
'\n'
|
||||
|
@ -9167,7 +9234,11 @@ topics = {'assert': 'The "assert" statement\n'
|
|||
' estimated length for the object (which may be greater or '
|
||||
'less than\n'
|
||||
' the actual length). The length must be an integer ">=" 0. '
|
||||
'This\n'
|
||||
'The\n'
|
||||
' return value may also be "NotImplemented", which is '
|
||||
'treated the\n'
|
||||
' same as if the "__length_hint__" method didn’t exist at '
|
||||
'all. This\n'
|
||||
' method is purely an optimization and is never required '
|
||||
'for\n'
|
||||
' correctness.\n'
|
||||
|
@ -9285,12 +9356,12 @@ topics = {'assert': 'The "assert" statement\n'
|
|||
'\n'
|
||||
'The membership test operators ("in" and "not in") are '
|
||||
'normally\n'
|
||||
'implemented as an iteration through a sequence. However, '
|
||||
'implemented as an iteration through a container. However, '
|
||||
'container\n'
|
||||
'objects can supply the following special method with a more '
|
||||
'efficient\n'
|
||||
'implementation, which also does not require the object be a '
|
||||
'sequence.\n'
|
||||
'implementation, which also does not require the object be '
|
||||
'iterable.\n'
|
||||
'\n'
|
||||
'object.__contains__(self, item)\n'
|
||||
'\n'
|
||||
|
@ -9756,9 +9827,21 @@ topics = {'assert': 'The "assert" statement\n'
|
|||
'For a list\n'
|
||||
' of possible encodings, see section Standard Encodings.\n'
|
||||
'\n'
|
||||
' By default, the *errors* argument is not checked for '
|
||||
'best\n'
|
||||
' performances, but only used at the first encoding '
|
||||
'error. Enable the\n'
|
||||
' development mode ("-X" "dev" option), or use a debug '
|
||||
'build, to\n'
|
||||
' check *errors*.\n'
|
||||
'\n'
|
||||
' Changed in version 3.1: Support for keyword arguments '
|
||||
'added.\n'
|
||||
'\n'
|
||||
' Changed in version 3.9: The *errors* is now checked in '
|
||||
'development\n'
|
||||
' mode and in debug mode.\n'
|
||||
'\n'
|
||||
'str.endswith(suffix[, start[, end]])\n'
|
||||
'\n'
|
||||
' Return "True" if the string ends with the specified '
|
||||
|
@ -9894,20 +9977,20 @@ topics = {'assert': 'The "assert" statement\n'
|
|||
'\n'
|
||||
'str.isalnum()\n'
|
||||
'\n'
|
||||
' Return true if all characters in the string are '
|
||||
' Return "True" if all characters in the string are '
|
||||
'alphanumeric and\n'
|
||||
' there is at least one character, false otherwise. A '
|
||||
'character "c"\n'
|
||||
' is alphanumeric if one of the following returns '
|
||||
' there is at least one character, "False" otherwise. A '
|
||||
'character\n'
|
||||
' "c" is alphanumeric if one of the following returns '
|
||||
'"True":\n'
|
||||
' "c.isalpha()", "c.isdecimal()", "c.isdigit()", or '
|
||||
'"c.isnumeric()".\n'
|
||||
'\n'
|
||||
'str.isalpha()\n'
|
||||
'\n'
|
||||
' Return true if all characters in the string are '
|
||||
' Return "True" if all characters in the string are '
|
||||
'alphabetic and\n'
|
||||
' there is at least one character, false otherwise. '
|
||||
' there is at least one character, "False" otherwise. '
|
||||
'Alphabetic\n'
|
||||
' characters are those characters defined in the Unicode '
|
||||
'character\n'
|
||||
|
@ -9921,45 +10004,46 @@ topics = {'assert': 'The "assert" statement\n'
|
|||
'\n'
|
||||
'str.isascii()\n'
|
||||
'\n'
|
||||
' Return true if the string is empty or all characters in '
|
||||
'the string\n'
|
||||
' are ASCII, false otherwise. ASCII characters have code '
|
||||
'points in\n'
|
||||
' the range U+0000-U+007F.\n'
|
||||
' Return "True" if the string is empty or all characters '
|
||||
'in the\n'
|
||||
' string are ASCII, "False" otherwise. ASCII characters '
|
||||
'have code\n'
|
||||
' points in the range U+0000-U+007F.\n'
|
||||
'\n'
|
||||
' New in version 3.7.\n'
|
||||
'\n'
|
||||
'str.isdecimal()\n'
|
||||
'\n'
|
||||
' Return true if all characters in the string are decimal '
|
||||
'characters\n'
|
||||
' and there is at least one character, false otherwise. '
|
||||
'Decimal\n'
|
||||
' characters are those that can be used to form numbers '
|
||||
'in base 10,\n'
|
||||
' e.g. U+0660, ARABIC-INDIC DIGIT ZERO. Formally a '
|
||||
'decimal character\n'
|
||||
' is a character in the Unicode General Category “Nd”.\n'
|
||||
' Return "True" if all characters in the string are '
|
||||
'decimal\n'
|
||||
' characters and there is at least one character, "False" '
|
||||
'otherwise.\n'
|
||||
' Decimal characters are those that can be used to form '
|
||||
'numbers in\n'
|
||||
' base 10, e.g. U+0660, ARABIC-INDIC DIGIT ZERO. '
|
||||
'Formally a decimal\n'
|
||||
' character is a character in the Unicode General '
|
||||
'Category “Nd”.\n'
|
||||
'\n'
|
||||
'str.isdigit()\n'
|
||||
'\n'
|
||||
' Return true if all characters in the string are digits '
|
||||
'and there is\n'
|
||||
' at least one character, false otherwise. Digits '
|
||||
'include decimal\n'
|
||||
' characters and digits that need special handling, such '
|
||||
'as the\n'
|
||||
' compatibility superscript digits. This covers digits '
|
||||
'which cannot\n'
|
||||
' be used to form numbers in base 10, like the Kharosthi '
|
||||
'numbers.\n'
|
||||
' Formally, a digit is a character that has the property '
|
||||
'value\n'
|
||||
' Numeric_Type=Digit or Numeric_Type=Decimal.\n'
|
||||
' Return "True" if all characters in the string are '
|
||||
'digits and there\n'
|
||||
' is at least one character, "False" otherwise. Digits '
|
||||
'include\n'
|
||||
' decimal characters and digits that need special '
|
||||
'handling, such as\n'
|
||||
' the compatibility superscript digits. This covers '
|
||||
'digits which\n'
|
||||
' cannot be used to form numbers in base 10, like the '
|
||||
'Kharosthi\n'
|
||||
' numbers. Formally, a digit is a character that has the '
|
||||
'property\n'
|
||||
' value Numeric_Type=Digit or Numeric_Type=Decimal.\n'
|
||||
'\n'
|
||||
'str.isidentifier()\n'
|
||||
'\n'
|
||||
' Return true if the string is a valid identifier '
|
||||
' Return "True" if the string is a valid identifier '
|
||||
'according to the\n'
|
||||
' language definition, section Identifiers and keywords.\n'
|
||||
'\n'
|
||||
|
@ -9978,32 +10062,33 @@ topics = {'assert': 'The "assert" statement\n'
|
|||
'\n'
|
||||
'str.islower()\n'
|
||||
'\n'
|
||||
' Return true if all cased characters [4] in the string '
|
||||
'are lowercase\n'
|
||||
' and there is at least one cased character, false '
|
||||
'otherwise.\n'
|
||||
' Return "True" if all cased characters [4] in the string '
|
||||
'are\n'
|
||||
' lowercase and there is at least one cased character, '
|
||||
'"False"\n'
|
||||
' otherwise.\n'
|
||||
'\n'
|
||||
'str.isnumeric()\n'
|
||||
'\n'
|
||||
' Return true if all characters in the string are numeric '
|
||||
'characters,\n'
|
||||
' and there is at least one character, false otherwise. '
|
||||
'Numeric\n'
|
||||
' characters include digit characters, and all characters '
|
||||
'that have\n'
|
||||
' the Unicode numeric value property, e.g. U+2155, VULGAR '
|
||||
'FRACTION\n'
|
||||
' ONE FIFTH. Formally, numeric characters are those with '
|
||||
'the\n'
|
||||
' property value Numeric_Type=Digit, Numeric_Type=Decimal '
|
||||
'or\n'
|
||||
' Return "True" if all characters in the string are '
|
||||
'numeric\n'
|
||||
' characters, and there is at least one character, '
|
||||
'"False" otherwise.\n'
|
||||
' Numeric characters include digit characters, and all '
|
||||
'characters\n'
|
||||
' that have the Unicode numeric value property, e.g. '
|
||||
'U+2155, VULGAR\n'
|
||||
' FRACTION ONE FIFTH. Formally, numeric characters are '
|
||||
'those with\n'
|
||||
' the property value Numeric_Type=Digit, '
|
||||
'Numeric_Type=Decimal or\n'
|
||||
' Numeric_Type=Numeric.\n'
|
||||
'\n'
|
||||
'str.isprintable()\n'
|
||||
'\n'
|
||||
' Return true if all characters in the string are '
|
||||
' Return "True" if all characters in the string are '
|
||||
'printable or the\n'
|
||||
' string is empty, false otherwise. Nonprintable '
|
||||
' string is empty, "False" otherwise. Nonprintable '
|
||||
'characters are\n'
|
||||
' those characters defined in the Unicode character '
|
||||
'database as\n'
|
||||
|
@ -10019,32 +10104,45 @@ topics = {'assert': 'The "assert" statement\n'
|
|||
'\n'
|
||||
'str.isspace()\n'
|
||||
'\n'
|
||||
' Return true if there are only whitespace characters in '
|
||||
'the string\n'
|
||||
' and there is at least one character, false otherwise. '
|
||||
'Whitespace\n'
|
||||
' characters are those characters defined in the Unicode '
|
||||
'character\n'
|
||||
' database as “Other” or “Separator” and those with '
|
||||
'bidirectional\n'
|
||||
' property being one of “WS”, “B”, or “S”.\n'
|
||||
' Return "True" if there are only whitespace characters '
|
||||
'in the string\n'
|
||||
' and there is at least one character, "False" '
|
||||
'otherwise.\n'
|
||||
'\n'
|
||||
' A character is *whitespace* if in the Unicode character '
|
||||
'database\n'
|
||||
' (see "unicodedata"), either its general category is '
|
||||
'"Zs"\n'
|
||||
' (“Separator, space”), or its bidirectional class is one '
|
||||
'of "WS",\n'
|
||||
' "B", or "S".\n'
|
||||
'\n'
|
||||
'str.istitle()\n'
|
||||
'\n'
|
||||
' Return true if the string is a titlecased string and '
|
||||
' Return "True" if the string is a titlecased string and '
|
||||
'there is at\n'
|
||||
' least one character, for example uppercase characters '
|
||||
'may only\n'
|
||||
' follow uncased characters and lowercase characters only '
|
||||
'cased ones.\n'
|
||||
' Return false otherwise.\n'
|
||||
' Return "False" otherwise.\n'
|
||||
'\n'
|
||||
'str.isupper()\n'
|
||||
'\n'
|
||||
' Return true if all cased characters [4] in the string '
|
||||
'are uppercase\n'
|
||||
' and there is at least one cased character, false '
|
||||
'otherwise.\n'
|
||||
' Return "True" if all cased characters [4] in the string '
|
||||
'are\n'
|
||||
' uppercase and there is at least one cased character, '
|
||||
'"False"\n'
|
||||
' otherwise.\n'
|
||||
'\n'
|
||||
" >>> 'BANANA'.isupper()\n"
|
||||
' True\n'
|
||||
" >>> 'banana'.isupper()\n"
|
||||
' False\n'
|
||||
" >>> 'baNana'.isupper()\n"
|
||||
' False\n'
|
||||
" >>> ' '.isupper()\n"
|
||||
' False\n'
|
||||
'\n'
|
||||
'str.join(iterable)\n'
|
||||
'\n'
|
||||
|
@ -10280,7 +10378,7 @@ topics = {'assert': 'The "assert" statement\n'
|
|||
' | Representation | '
|
||||
'Description |\n'
|
||||
' '
|
||||
'+=========================+===============================+\n'
|
||||
'|=========================|===============================|\n'
|
||||
' | "\\n" | Line '
|
||||
'Feed |\n'
|
||||
' '
|
||||
|
@ -10619,7 +10717,7 @@ topics = {'assert': 'The "assert" statement\n'
|
|||
'+-------------------+-----------------------------------+---------+\n'
|
||||
'| Escape Sequence | Meaning | Notes '
|
||||
'|\n'
|
||||
'+===================+===================================+=========+\n'
|
||||
'|===================|===================================|=========|\n'
|
||||
'| "\\newline" | Backslash and newline ignored '
|
||||
'| |\n'
|
||||
'+-------------------+-----------------------------------+---------+\n'
|
||||
|
@ -10665,7 +10763,7 @@ topics = {'assert': 'The "assert" statement\n'
|
|||
'+-------------------+-----------------------------------+---------+\n'
|
||||
'| Escape Sequence | Meaning | Notes '
|
||||
'|\n'
|
||||
'+===================+===================================+=========+\n'
|
||||
'|===================|===================================|=========|\n'
|
||||
'| "\\N{name}" | Character named *name* in the | '
|
||||
'(4) |\n'
|
||||
'| | Unicode database | '
|
||||
|
@ -10716,13 +10814,9 @@ topics = {'assert': 'The "assert" statement\n'
|
|||
'\n'
|
||||
' Changed in version 3.6: Unrecognized escape sequences produce '
|
||||
'a\n'
|
||||
' "DeprecationWarning".\n'
|
||||
'\n'
|
||||
' Changed in version 3.8: Unrecognized escape sequences produce '
|
||||
' "DeprecationWarning". In a future Python version they will be '
|
||||
'a\n'
|
||||
' "SyntaxWarning". In some future version of Python they will '
|
||||
'be a\n'
|
||||
' "SyntaxError".\n'
|
||||
' "SyntaxWarning" and eventually a "SyntaxError".\n'
|
||||
'\n'
|
||||
'Even in a raw literal, quotes can be escaped with a backslash, '
|
||||
'but the\n'
|
||||
|
@ -11303,7 +11397,7 @@ topics = {'assert': 'The "assert" statement\n'
|
|||
' | Attribute | Meaning '
|
||||
'| |\n'
|
||||
' '
|
||||
'+===========================+=================================+=============+\n'
|
||||
'|===========================|=================================|=============|\n'
|
||||
' | "__doc__" | The function’s documentation '
|
||||
'| Writable |\n'
|
||||
' | | string, or "None" if '
|
||||
|
@ -12106,7 +12200,8 @@ topics = {'assert': 'The "assert" statement\n'
|
|||
" >>> c = dict(zip(['one', 'two', 'three'], [1, 2, 3]))\n"
|
||||
" >>> d = dict([('two', 2), ('one', 1), ('three', 3)])\n"
|
||||
" >>> e = dict({'three': 3, 'one': 1, 'two': 2})\n"
|
||||
' >>> a == b == c == d == e\n'
|
||||
" >>> f = dict({'one': 1, 'three': 3}, two=2)\n"
|
||||
' >>> a == b == c == d == e == f\n'
|
||||
' True\n'
|
||||
'\n'
|
||||
' Providing keyword arguments as in the first example only '
|
||||
|
@ -12119,6 +12214,11 @@ topics = {'assert': 'The "assert" statement\n'
|
|||
'therefore,\n'
|
||||
' custom mapping types should support too):\n'
|
||||
'\n'
|
||||
' list(d)\n'
|
||||
'\n'
|
||||
' Return a list of all the keys used in the dictionary '
|
||||
'*d*.\n'
|
||||
'\n'
|
||||
' len(d)\n'
|
||||
'\n'
|
||||
' Return the number of items in the dictionary *d*.\n'
|
||||
|
@ -12287,11 +12387,21 @@ topics = {'assert': 'The "assert" statement\n'
|
|||
'the\n'
|
||||
' documentation of view objects.\n'
|
||||
'\n'
|
||||
' An equality comparison between one "dict.values()" '
|
||||
'view and\n'
|
||||
' another will always return "False". This also applies '
|
||||
'when\n'
|
||||
' comparing "dict.values()" to itself:\n'
|
||||
'\n'
|
||||
" >>> d = {'a': 1}\n"
|
||||
' >>> d.values() == d.values()\n'
|
||||
' False\n'
|
||||
'\n'
|
||||
' Dictionaries compare equal if and only if they have the '
|
||||
'same "(key,\n'
|
||||
' value)" pairs. Order comparisons (‘<’, ‘<=’, ‘>=’, ‘>’) '
|
||||
'raise\n'
|
||||
' "TypeError".\n'
|
||||
' value)" pairs (regardless of ordering). Order comparisons '
|
||||
'(‘<’,\n'
|
||||
' ‘<=’, ‘>=’, ‘>’) raise "TypeError".\n'
|
||||
'\n'
|
||||
' Dictionaries preserve insertion order. Note that '
|
||||
'updating a key\n'
|
||||
|
@ -12577,7 +12687,7 @@ topics = {'assert': 'The "assert" statement\n'
|
|||
'+----------------------------+----------------------------------+------------+\n'
|
||||
'| Operation | Result '
|
||||
'| Notes |\n'
|
||||
'+============================+==================================+============+\n'
|
||||
'|============================|==================================|============|\n'
|
||||
'| "x in s" | "True" if an item of *s* is '
|
||||
'| (1) |\n'
|
||||
'| | equal to *x*, else "False" '
|
||||
|
@ -12806,7 +12916,7 @@ topics = {'assert': 'The "assert" statement\n'
|
|||
'+--------------------------------+----------------------------------+-----------------------+\n'
|
||||
'| Operation | '
|
||||
'Result | Notes |\n'
|
||||
'+================================+==================================+=======================+\n'
|
||||
'|================================|==================================|=======================|\n'
|
||||
'| "s[i] = x" | item *i* of *s* is replaced '
|
||||
'by | |\n'
|
||||
'| | '
|
||||
|
@ -13268,7 +13378,7 @@ topics = {'assert': 'The "assert" statement\n'
|
|||
'| Operation | '
|
||||
'Result | Notes '
|
||||
'|\n'
|
||||
'+================================+==================================+=======================+\n'
|
||||
'|================================|==================================|=======================|\n'
|
||||
'| "s[i] = x" | item *i* of *s* is '
|
||||
'replaced by | |\n'
|
||||
'| | '
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue