|
1 | 1 | # -*- coding: utf-8 -*-
|
2 |
| -# Autogenerated by Sphinx on Mon Nov 21 23:22:05 2016 |
| 2 | +# Autogenerated by Sphinx on Tue Dec 6 18:51:51 2016 |
3 | 3 | topics = {'assert': '\n'
|
4 | 4 | 'The "assert" statement\n'
|
5 | 5 | '**********************\n'
|
|
8503 | 8503 | 'defined at the\n'
|
8504 | 8504 | 'class scope. Class variables must be accessed through the '
|
8505 | 8505 | 'first\n'
|
8506 |
| - 'parameter of instance or class methods, and cannot be ' |
8507 |
| - 'accessed at all\n' |
8508 |
| - 'from static methods.\n' |
| 8506 | + 'parameter of instance or class methods, or through the ' |
| 8507 | + 'implicit\n' |
| 8508 | + 'lexically scoped "__class__" reference described in the next ' |
| 8509 | + 'section.\n' |
8509 | 8510 | '\n'
|
8510 | 8511 | '\n'
|
8511 | 8512 | 'Creating the class object\n'
|
|
8535 | 8536 | 'passed to the\n'
|
8536 | 8537 | 'method.\n'
|
8537 | 8538 | '\n'
|
| 8539 | + '**CPython implementation detail:** In CPython 3.6 and later, ' |
| 8540 | + 'the\n' |
| 8541 | + '"__class__" cell is passed to the metaclass as a ' |
| 8542 | + '"__classcell__" entry\n' |
| 8543 | + 'in the class namespace. If present, this must be propagated ' |
| 8544 | + 'up to the\n' |
| 8545 | + '"type.__new__" call in order for the class to be ' |
| 8546 | + 'initialised\n' |
| 8547 | + 'correctly. Failing to do so will result in a ' |
| 8548 | + '"DeprecationWarning" in\n' |
| 8549 | + 'Python 3.6, and a "RuntimeWarning" in the future.\n' |
| 8550 | + '\n' |
| 8551 | + 'When using the default metaclass "type", or any metaclass ' |
| 8552 | + 'that\n' |
| 8553 | + 'ultimately calls "type.__new__", the following additional\n' |
| 8554 | + 'customisation steps are invoked after creating the class ' |
| 8555 | + 'object:\n' |
| 8556 | + '\n' |
| 8557 | + '* first, "type.__new__" collects all of the descriptors in ' |
| 8558 | + 'the class\n' |
| 8559 | + ' namespace that define a "__set_name__()" method;\n' |
| 8560 | + '\n' |
| 8561 | + '* second, all of these "__set_name__" methods are called ' |
| 8562 | + 'with the\n' |
| 8563 | + ' class being defined and the assigned name of that ' |
| 8564 | + 'particular\n' |
| 8565 | + ' descriptor; and\n' |
| 8566 | + '\n' |
| 8567 | + '* finally, the "__init_subclass__()" hook is called on the ' |
| 8568 | + 'immediate\n' |
| 8569 | + ' parent of the new class in its method resolution order.\n' |
| 8570 | + '\n' |
8538 | 8571 | 'After the class object is created, it is passed to the '
|
8539 | 8572 | 'class\n'
|
8540 | 8573 | 'decorators included in the class definition (if any) and the '
|
|
0 commit comments