[Python-checkins] cpython (merge default -> default): Merge from releasing branch

ned.deily python-checkins at python.org
Mon Aug 15 22:41:59 EDT 2016


https://hg.python.org/cpython/rev/4f324dce8adb
changeset:   102679:4f324dce8adb
parent:      102674:d277870a6012
parent:      102678:fb147ca3a550
user:        Ned Deily <nad at python.org>
date:        Mon Aug 15 22:41:17 2016 -0400
summary:
  Merge from releasing branch

files:
  .hgtags                  |    1 +
  Include/patchlevel.h     |    4 +-
  Lib/pydoc_data/topics.py |  132 +++++++++++++++++++++-----
  Misc/NEWS                |   14 ++-
  README                   |    2 +-
  5 files changed, 122 insertions(+), 31 deletions(-)


diff --git a/.hgtags b/.hgtags
--- a/.hgtags
+++ b/.hgtags
@@ -169,3 +169,4 @@
 5896da372fb044e38595fb74495de1e1e7c8fb3c v3.6.0a1
 37889342355223e2fc1438de3dc7ffcd625c60f7 v3.6.0a2
 f3edf13dc339b8942ae6b309771ab197dd8ce6fa v3.6.0a3
+017cf260936b444788c9b671d195b7bfd83dbd25 v3.6.0a4
diff --git a/Include/patchlevel.h b/Include/patchlevel.h
--- a/Include/patchlevel.h
+++ b/Include/patchlevel.h
@@ -20,10 +20,10 @@
 #define PY_MINOR_VERSION	6
 #define PY_MICRO_VERSION	0
 #define PY_RELEASE_LEVEL	PY_RELEASE_LEVEL_ALPHA
-#define PY_RELEASE_SERIAL	3
+#define PY_RELEASE_SERIAL	4
 
 /* Version as a string */
-#define PY_VERSION      	"3.6.0a3+"
+#define PY_VERSION      	"3.6.0a4+"
 /*--end constants--*/
 
 /* Version as a single 4-byte hex number, e.g. 0x010502B2 == 1.5.2b2.
diff --git a/Lib/pydoc_data/topics.py b/Lib/pydoc_data/topics.py
--- a/Lib/pydoc_data/topics.py
+++ b/Lib/pydoc_data/topics.py
@@ -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 @@
                      '*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 @@
           '\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 @@
           '   @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 @@
              '   @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 @@
              '\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 @@
              '   @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 @@
              '\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 @@
              '   @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 @@
            '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 @@
                  '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 @@
                  '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 '
diff --git a/Misc/NEWS b/Misc/NEWS
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -2,10 +2,22 @@
 Python News
 +++++++++++
 
+What's New in Python 3.6.0 beta 1
+=================================
+
+*Release date: XXXX-XX-XX*
+
+Core and Builtins
+-----------------
+
+Library
+-------
+
+
 What's New in Python 3.6.0 alpha 4
 ==================================
 
-*Release date: XXXX-XX-XX*
+*Release date: 2016-08-15*
 
 Core and Builtins
 -----------------
diff --git a/README b/README
--- a/README
+++ b/README
@@ -1,4 +1,4 @@
-This is Python version 3.6.0 alpha 3
+This is Python version 3.6.0 alpha 4
 ====================================
 
 Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011,

-- 
Repository URL: https://hg.python.org/cpython


More information about the Python-checkins mailing list