|
1 | 1 | # -*- coding: utf-8 -*-
|
2 |
| -# Autogenerated by Sphinx on Mon Mar 25 20:32:23 2019 |
| 2 | +# Autogenerated by Sphinx on Mon May 6 20:27:55 2019 |
3 | 3 | topics = {'assert': 'The "assert" statement\n'
|
4 | 4 | '**********************\n'
|
5 | 5 | '\n'
|
|
162 | 162 | '\n'
|
163 | 163 | ' Note: If the object is a class instance and the attribute '
|
164 | 164 | 'reference\n'
|
165 |
| - ' occurs on both sides of the assignment operator, the RHS ' |
166 |
| - 'expression,\n' |
167 |
| - ' "a.x" can access either an instance attribute or (if no ' |
168 |
| - 'instance\n' |
169 |
| - ' attribute exists) a class attribute. The LHS target "a.x" ' |
170 |
| - 'is always\n' |
171 |
| - ' set as an instance attribute, creating it if necessary. ' |
172 |
| - 'Thus, the\n' |
173 |
| - ' two occurrences of "a.x" do not necessarily refer to the ' |
174 |
| - 'same\n' |
175 |
| - ' attribute: if the RHS expression refers to a class ' |
176 |
| - 'attribute, the\n' |
177 |
| - ' LHS creates a new instance attribute as the target of the\n' |
178 |
| - ' assignment:\n' |
| 165 | + ' occurs on both sides of the assignment operator, the ' |
| 166 | + 'right-hand side\n' |
| 167 | + ' expression, "a.x" can access either an instance attribute or ' |
| 168 | + '(if no\n' |
| 169 | + ' instance attribute exists) a class attribute. The left-hand ' |
| 170 | + 'side\n' |
| 171 | + ' target "a.x" is always set as an instance attribute, ' |
| 172 | + 'creating it if\n' |
| 173 | + ' necessary. Thus, the two occurrences of "a.x" do not ' |
| 174 | + 'necessarily\n' |
| 175 | + ' refer to the same attribute: if the right-hand side ' |
| 176 | + 'expression\n' |
| 177 | + ' refers to a class attribute, the left-hand side creates a ' |
| 178 | + 'new\n' |
| 179 | + ' instance attribute as the target of the assignment:\n' |
179 | 180 | '\n'
|
180 | 181 | ' class Cls:\n'
|
181 | 182 | ' x = 3 # class variable\n'
|
|
3302 | 3303 | '"str.format()"\n'
|
3303 | 3304 | ' method, to produce a “formatted” string representation '
|
3304 | 3305 | 'of an\n'
|
3305 |
| - ' object. The "format_spec" argument is a string that ' |
| 3306 | + ' object. The *format_spec* argument is a string that ' |
3306 | 3307 | 'contains a\n'
|
3307 | 3308 | ' description of the formatting options desired. The '
|
3308 | 3309 | 'interpretation\n'
|
3309 |
| - ' of the "format_spec" argument is up to the type ' |
| 3310 | + ' of the *format_spec* argument is up to the type ' |
3310 | 3311 | 'implementing\n'
|
3311 | 3312 | ' "__format__()", however most classes will either '
|
3312 | 3313 | 'delegate\n'
|
|
6189 | 6190 | 'end up importing "pkg.mod". If you execute "from ..subpkg2 import '
|
6190 | 6191 | 'mod"\n'
|
6191 | 6192 | 'from within "pkg.subpkg1" you will import "pkg.subpkg2.mod". The\n'
|
6192 |
| - 'specification for relative imports is contained within **PEP ' |
6193 |
| - '328**.\n' |
| 6193 | + 'specification for relative imports is contained in the Package\n' |
| 6194 | + 'Relative Imports section.\n' |
6194 | 6195 | '\n'
|
6195 | 6196 | '"importlib.import_module()" is provided to support applications '
|
6196 | 6197 | 'that\n'
|
|
8002 | 8003 | '"str.format()"\n'
|
8003 | 8004 | ' method, to produce a “formatted” string representation of '
|
8004 | 8005 | 'an\n'
|
8005 |
| - ' object. The "format_spec" argument is a string that ' |
| 8006 | + ' object. The *format_spec* argument is a string that ' |
8006 | 8007 | 'contains a\n'
|
8007 | 8008 | ' description of the formatting options desired. The '
|
8008 | 8009 | 'interpretation\n'
|
8009 |
| - ' of the "format_spec" argument is up to the type ' |
| 8010 | + ' of the *format_spec* argument is up to the type ' |
8010 | 8011 | 'implementing\n'
|
8011 | 8012 | ' "__format__()", however most classes will either '
|
8012 | 8013 | 'delegate\n'
|
|
8768 | 8769 | 'When a class definition is executed, the following steps '
|
8769 | 8770 | 'occur:\n'
|
8770 | 8771 | '\n'
|
8771 |
| - '* MRO entries are resolved\n' |
| 8772 | + '* MRO entries are resolved;\n' |
8772 | 8773 | '\n'
|
8773 |
| - '* the appropriate metaclass is determined\n' |
| 8774 | + '* the appropriate metaclass is determined;\n' |
8774 | 8775 | '\n'
|
8775 |
| - '* the class namespace is prepared\n' |
| 8776 | + '* the class namespace is prepared;\n' |
8776 | 8777 | '\n'
|
8777 |
| - '* the class body is executed\n' |
| 8778 | + '* the class body is executed;\n' |
8778 | 8779 | '\n'
|
8779 |
| - '* the class object is created\n' |
| 8780 | + '* the class object is created.\n' |
8780 | 8781 | '\n'
|
8781 | 8782 | '\n'
|
8782 | 8783 | 'Resolving MRO entries\n'
|
|
8806 | 8807 | '\n'
|
8807 | 8808 | '* if no bases and no explicit metaclass are given, then '
|
8808 | 8809 | '"type()" is\n'
|
8809 |
| - ' used\n' |
| 8810 | + ' used;\n' |
8810 | 8811 | '\n'
|
8811 | 8812 | '* if an explicit metaclass is given and it is *not* an '
|
8812 | 8813 | 'instance of\n'
|
8813 |
| - ' "type()", then it is used directly as the metaclass\n' |
| 8814 | + ' "type()", then it is used directly as the metaclass;\n' |
8814 | 8815 | '\n'
|
8815 | 8816 | '* if an instance of "type()" is given as the explicit '
|
8816 | 8817 | 'metaclass, or\n'
|
8817 | 8818 | ' bases are defined, then the most derived metaclass is '
|
8818 |
| - 'used\n' |
| 8819 | + 'used.\n' |
8819 | 8820 | '\n'
|
8820 | 8821 | 'The most derived metaclass is selected from the explicitly '
|
8821 | 8822 | 'specified\n'
|
|
8931 | 8932 | 'with the\n'
|
8932 | 8933 | ' class being defined and the assigned name of that '
|
8933 | 8934 | 'particular\n'
|
8934 |
| - ' descriptor; and\n' |
| 8935 | + ' descriptor;\n' |
8935 | 8936 | '\n'
|
8936 | 8937 | '* finally, the "__init_subclass__()" hook is called on the '
|
8937 | 8938 | 'immediate\n'
|
|
9030 | 9031 | '\n'
|
9031 | 9032 | 'One can implement the generic class syntax as specified by '
|
9032 | 9033 | '**PEP 484**\n'
|
9033 |
| - '(for example "List[int]") by defining a special method\n' |
| 9034 | + '(for example "List[int]") by defining a special method:\n' |
9034 | 9035 | '\n'
|
9035 | 9036 | 'classmethod object.__class_getitem__(cls, key)\n'
|
9036 | 9037 | '\n'
|
|
9672 | 9673 | 'capitalized\n'
|
9673 | 9674 | ' and the rest lowercased.\n'
|
9674 | 9675 | '\n'
|
| 9676 | + ' Changed in version 3.8: The first character is now put ' |
| 9677 | + 'into\n' |
| 9678 | + ' titlecase rather than uppercase. This means that ' |
| 9679 | + 'characters like\n' |
| 9680 | + ' digraphs will only have their first letter capitalized, ' |
| 9681 | + 'instead of\n' |
| 9682 | + ' the full character.\n' |
| 9683 | + '\n' |
9675 | 9684 | 'str.casefold()\n'
|
9676 | 9685 | '\n'
|
9677 | 9686 | ' Return a casefolded copy of the string. Casefolded '
|
|
10416 | 10425 | ' >>> def titlecase(s):\n'
|
10417 | 10426 | ' ... return re.sub(r"[A-Za-z]+(\'[A-Za-z]+)?",\n'
|
10418 | 10427 | ' ... lambda mo: '
|
10419 |
| - 'mo.group(0)[0].upper() +\n' |
10420 |
| - ' ... ' |
10421 |
| - 'mo.group(0)[1:].lower(),\n' |
| 10428 | + 'mo.group(0).capitalize(),\n' |
10422 | 10429 | ' ... s)\n'
|
10423 | 10430 | ' ...\n'
|
10424 | 10431 | ' >>> titlecase("they\'re bill\'s friends.")\n'
|
@@ -11286,17 +11293,17 @@
|
11286 | 11293 | '| |\n'
|
11287 | 11294 | ' | | unavailable; not inherited by '
|
11288 | 11295 | '| |\n'
|
11289 |
| - ' | | subclasses ' |
| 11296 | + ' | | subclasses. ' |
11290 | 11297 | '| |\n'
|
11291 | 11298 | ' '
|
11292 | 11299 | '+---------------------------+---------------------------------+-------------+\n'
|
11293 |
| - ' | "__name__" | The function’s name ' |
| 11300 | + ' | "__name__" | The function’s name. ' |
11294 | 11301 | '| Writable |\n'
|
11295 | 11302 | ' '
|
11296 | 11303 | '+---------------------------+---------------------------------+-------------+\n'
|
11297 |
| - ' | "__qualname__" | The function’s *qualified name* ' |
| 11304 | + ' | "__qualname__" | The function’s *qualified ' |
11298 | 11305 | '| Writable |\n'
|
11299 |
| - ' | | New in version 3.3. ' |
| 11306 | + ' | | name*. New in version 3.3. ' |
11300 | 11307 | '| |\n'
|
11301 | 11308 | ' '
|
11302 | 11309 | '+---------------------------+---------------------------------+-------------+\n'
|
|
11316 | 11323 | '| |\n'
|
11317 | 11324 | ' | | or "None" if no arguments have '
|
11318 | 11325 | '| |\n'
|
11319 |
| - ' | | a default value ' |
| 11326 | + ' | | a default value. ' |
11320 | 11327 | '| |\n'
|
11321 | 11328 | ' '
|
11322 | 11329 | '+---------------------------+---------------------------------+-------------+\n'
|
|
12172 | 12179 | '\n'
|
12173 | 12180 | ' "fromkeys()" is a class method that returns a new '
|
12174 | 12181 | 'dictionary.\n'
|
12175 |
| - ' *value* defaults to "None".\n' |
| 12182 | + ' *value* defaults to "None". All of the values refer ' |
| 12183 | + 'to just a\n' |
| 12184 | + ' single instance, so it generally doesn’t make sense ' |
| 12185 | + 'for *value*\n' |
| 12186 | + ' to be a mutable object such as an empty list. To get ' |
| 12187 | + 'distinct\n' |
| 12188 | + ' values, use a dict comprehension instead.\n' |
12176 | 12189 | '\n'
|
12177 | 12190 | ' get(key[, default])\n'
|
12178 | 12191 | '\n'
|
|
0 commit comments