[Python-checkins] cpython: Doc updates for PEPs 520 and 468.
eric.snow
python-checkins at python.org
Fri Sep 9 14:22:42 EDT 2016
https://hg.python.org/cpython/rev/07fa802cafae
changeset: 103426:07fa802cafae
user: Eric Snow <ericsnowcurrently at gmail.com>
date: Fri Sep 09 11:22:14 2016 -0700
summary:
Doc updates for PEPs 520 and 468.
files:
Doc/reference/datamodel.rst | 6 ++--
Doc/whatsnew/3.6.rst | 28 ++++++++++++++++--------
2 files changed, 22 insertions(+), 12 deletions(-)
diff --git a/Doc/reference/datamodel.rst b/Doc/reference/datamodel.rst
--- a/Doc/reference/datamodel.rst
+++ b/Doc/reference/datamodel.rst
@@ -1801,9 +1801,9 @@
in the local namespace as the defined class.
When a new class is created by ``type.__new__``, the object provided as the
-namespace parameter is copied to a standard Python dictionary and the original
-object is discarded. The new copy becomes the :attr:`~object.__dict__` attribute
-of the class object.
+namespace parameter is copied to a new ordered mapping and the original
+object is discarded. The new copy is wrapped in a read-only proxy, which
+becomes the :attr:`~object.__dict__` attribute of the class object.
.. seealso::
diff --git a/Doc/whatsnew/3.6.rst b/Doc/whatsnew/3.6.rst
--- a/Doc/whatsnew/3.6.rst
+++ b/Doc/whatsnew/3.6.rst
@@ -116,7 +116,10 @@
:pep:`4XX` - Python Virtual Environments
PEP written by Carl Meyer
-.. XXX PEP 520: :ref:`Preserving Class Attribute Definition Order<whatsnew-deforder>`
+* PEP 520: :ref:`Preserving Class Attribute Definition Order<whatsnew-deforder>`
+
+* PEP 468: :ref:`Preserving Keyword Argument Order<whatsnew-kwargs>`
+
New Features
============
@@ -380,17 +383,10 @@
Attributes in a class definition body have a natural ordering: the same
order in which the names appear in the source. This order is now
-preserved in the new class's ``__definition_order__`` attribute. It is
-a tuple of the attribute names, in the order in which they appear in
-the class definition body.
-
-For types that don't have a definition (e.g. builtins), or the attribute
-order could not be determined, ``__definition_order__`` is ``None``.
+preserved in the new class's ``__dict__`` attribute.
Also, the effective default class *execution* namespace (returned from
``type.__prepare__()``) is now an insertion-order-preserving mapping.
-For CPython, it is now ``collections.OrderedDict``. Note that the
-class namespace, ``cls.__dict__``, is unchanged.
.. seealso::
@@ -398,6 +394,20 @@
PEP written and implemented by Eric Snow.
+.. _whatsnew-kwargs:
+
+PEP 468: Preserving Keyword Argument Order
+==========================================
+
+``**kwargs`` in a function signature is now guaranteed to be an
+insertion-order-preserving mapping.
+
+.. seealso::
+
+ :pep:`468` - Preserving Keyword Argument Order
+ PEP written and implemented by Eric Snow.
+
+
PEP 509: Add a private version to dict
--------------------------------------
--
Repository URL: https://hg.python.org/cpython
More information about the Python-checkins
mailing list