]> granicus.if.org Git - python/commitdiff
Update pydoc topics for 3.6.0a4
authorNed Deily <nad@python.org>
Mon, 15 Aug 2016 20:12:59 +0000 (16:12 -0400)
committerNed Deily <nad@python.org>
Mon, 15 Aug 2016 20:12:59 +0000 (16:12 -0400)
Lib/pydoc_data/topics.py

index 7378dc9eb82fcf3e4c3550ec1aa7a93ab68dea8a..590f6135cfb5a3de5c0ddc6c8a7302e35c47c0cf 100644 (file)
@@ -1,5 +1,5 @@
 # -*- coding: utf-8 -*-
-# Autogenerated by Sphinx on Mon Jul 11 15:30:24 2016
+# Autogenerated by Sphinx on Mon Aug 15 16:11:20 2016
 topics = {'assert': '\n'
            'The "assert" statement\n'
            '**********************\n'
@@ -569,6 +569,14 @@ topics = {'assert': '\n'
                      '*instance* of the\n'
                      '   owner class.\n'
                      '\n'
+                     'object.__set_name__(self, owner, name)\n'
+                     '\n'
+                     '   Called at the time the owning class *owner* is '
+                     'created. The\n'
+                     '   descriptor has been assigned to *name*.\n'
+                     '\n'
+                     '   New in version 3.6.\n'
+                     '\n'
                      'The attribute "__objclass__" is interpreted by the '
                      '"inspect" module as\n'
                      'specifying the class where this object was defined '
@@ -1338,13 +1346,12 @@ topics = {'assert': '\n'
           '\n'
           'A class definition is an executable statement.  The inheritance '
           'list\n'
-          'usually gives a list of base classes (see Customizing class '
-          'creation\n'
-          'for more advanced uses), so each item in the list should evaluate '
-          'to a\n'
-          'class object which allows subclassing.  Classes without an '
-          'inheritance\n'
-          'list inherit, by default, from the base class "object"; hence,\n'
+          'usually gives a list of base classes (see Metaclasses for more\n'
+          'advanced uses), so each item in the list should evaluate to a '
+          'class\n'
+          'object which allows subclassing.  Classes without an inheritance '
+          'list\n'
+          'inherit, by default, from the base class "object"; hence,\n'
           '\n'
           '   class Foo:\n'
           '       pass\n'
@@ -1377,16 +1384,14 @@ topics = {'assert': '\n'
           '   @f2\n'
           '   class Foo: pass\n'
           '\n'
-          'is equivalent to\n'
+          'is roughly equivalent to\n'
           '\n'
           '   class Foo: pass\n'
           '   Foo = f1(arg)(f2(Foo))\n'
           '\n'
           'The evaluation rules for the decorator expressions are the same as '
           'for\n'
-          'function decorators.  The result must be a class object, which is '
-          'then\n'
-          'bound to the class name.\n'
+          'function decorators.  The result is then bound to the class name.\n'
           '\n'
           "**Programmer's note:** Variables defined in the class definition "
           'are\n'
@@ -2312,11 +2317,15 @@ topics = {'assert': '\n'
              '   @f2\n'
              '   def func(): pass\n'
              '\n'
-             'is equivalent to\n'
+             'is roughly equivalent to\n'
              '\n'
              '   def func(): pass\n'
              '   func = f1(arg)(f2(func))\n'
              '\n'
+             'except that the original function is not temporarily bound to '
+             'the name\n'
+             '"func".\n'
+             '\n'
              'When one or more *parameters* have the form *parameter* "="\n'
              '*expression*, the function is said to have "default parameter '
              'values."\n'
@@ -2440,13 +2449,12 @@ topics = {'assert': '\n'
              '\n'
              'A class definition is an executable statement.  The inheritance '
              'list\n'
-             'usually gives a list of base classes (see Customizing class '
-             'creation\n'
-             'for more advanced uses), so each item in the list should '
-             'evaluate to a\n'
-             'class object which allows subclassing.  Classes without an '
-             'inheritance\n'
-             'list inherit, by default, from the base class "object"; hence,\n'
+             'usually gives a list of base classes (see Metaclasses for more\n'
+             'advanced uses), so each item in the list should evaluate to a '
+             'class\n'
+             'object which allows subclassing.  Classes without an inheritance '
+             'list\n'
+             'inherit, by default, from the base class "object"; hence,\n'
              '\n'
              '   class Foo:\n'
              '       pass\n'
@@ -2482,16 +2490,15 @@ topics = {'assert': '\n'
              '   @f2\n'
              '   class Foo: pass\n'
              '\n'
-             'is equivalent to\n'
+             'is roughly equivalent to\n'
              '\n'
              '   class Foo: pass\n'
              '   Foo = f1(arg)(f2(Foo))\n'
              '\n'
              'The evaluation rules for the decorator expressions are the same '
              'as for\n'
-             'function decorators.  The result must be a class object, which '
-             'is then\n'
-             'bound to the class name.\n'
+             'function decorators.  The result is then bound to the class '
+             'name.\n'
              '\n'
              "**Programmer's note:** Variables defined in the class definition "
              'are\n'
@@ -3776,7 +3783,7 @@ topics = {'assert': '\n'
              '\n'
              'interact\n'
              '\n'
-             '   Start an interative interpreter (using the "code" module) '
+             '   Start an interactive interpreter (using the "code" module) '
              'whose\n'
              '   global namespace contains all the (global and local) names '
              'found in\n'
@@ -5296,11 +5303,15 @@ topics = {'assert': '\n'
              '   @f2\n'
              '   def func(): pass\n'
              '\n'
-             'is equivalent to\n'
+             'is roughly equivalent to\n'
              '\n'
              '   def func(): pass\n'
              '   func = f1(arg)(f2(func))\n'
              '\n'
+             'except that the original function is not temporarily bound to '
+             'the name\n'
+             '"func".\n'
+             '\n'
              'When one or more *parameters* have the form *parameter* "="\n'
              '*expression*, the function is said to have "default parameter '
              'values."\n'
@@ -6032,7 +6043,7 @@ topics = {'assert': '\n'
            'expression"\n'
            'yields a function object.  The unnamed object behaves like a '
            'function\n'
-           'object defined with\n'
+           'object defined with:\n'
            '\n'
            '   def <lambda>(arguments):\n'
            '       return expression\n'
@@ -7964,6 +7975,14 @@ topics = {'assert': '\n'
                  'of the\n'
                  '   owner class.\n'
                  '\n'
+                 'object.__set_name__(self, owner, name)\n'
+                 '\n'
+                 '   Called at the time the owning class *owner* is created. '
+                 'The\n'
+                 '   descriptor has been assigned to *name*.\n'
+                 '\n'
+                 '   New in version 3.6.\n'
+                 '\n'
                  'The attribute "__objclass__" is interpreted by the "inspect" '
                  'module as\n'
                  'specifying the class where this object was defined (setting '
@@ -8188,6 +8207,65 @@ topics = {'assert': '\n'
                  'Customizing class creation\n'
                  '==========================\n'
                  '\n'
+                 'Whenever a class inherits from another class, '
+                 '*__init_subclass__* is\n'
+                 'called on that class. This way, it is possible to write '
+                 'classes which\n'
+                 'change the behavior of subclasses. This is closely related '
+                 'to class\n'
+                 'decorators, but where class decorators only affect the '
+                 'specific class\n'
+                 'they\'re applied to, "__init_subclass__" solely applies to '
+                 'future\n'
+                 'subclasses of the class defining the method.\n'
+                 '\n'
+                 'classmethod object.__init_subclass__(cls)\n'
+                 '\n'
+                 '   This method is called whenever the containing class is '
+                 'subclassed.\n'
+                 '   *cls* is then the new subclass. If defined as a normal '
+                 'instance\n'
+                 '   method, this method is implicitly converted to a class '
+                 'method.\n'
+                 '\n'
+                 '   Keyword arguments which are given to a new class are '
+                 'passed to the\n'
+                 '   parent\'s class "__init_subclass__". For compatibility '
+                 'with other\n'
+                 '   classes using "__init_subclass__", one should take out '
+                 'the needed\n'
+                 '   keyword arguments and pass the others over to the base '
+                 'class, as\n'
+                 '   in:\n'
+                 '\n'
+                 '      class Philosopher:\n'
+                 '          def __init_subclass__(cls, default_name, '
+                 '**kwargs):\n'
+                 '              super().__init_subclass__(**kwargs)\n'
+                 '              cls.default_name = default_name\n'
+                 '\n'
+                 '      class AustralianPhilosopher(Philosopher, '
+                 'default_name="Bruce"):\n'
+                 '          pass\n'
+                 '\n'
+                 '   The default implementation "object.__init_subclass__" '
+                 'does nothing,\n'
+                 '   but raises an error if it is called with any arguments.\n'
+                 '\n'
+                 '   Note: The metaclass hint "metaclass" is consumed by the '
+                 'rest of\n'
+                 '     the type machinery, and is never passed to '
+                 '"__init_subclass__"\n'
+                 '     implementations. The actual metaclass (rather than the '
+                 'explicit\n'
+                 '     hint) can be accessed as "type(cls)".\n'
+                 '\n'
+                 '   New in version 3.6.\n'
+                 '\n'
+                 '\n'
+                 'Metaclasses\n'
+                 '-----------\n'
+                 '\n'
                  'By default, classes are constructed using "type()". The '
                  'class body is\n'
                  'executed in a new namespace and the class name is bound '