cpython: 31875b244bdf (original) (raw)

Mercurial > cpython

changeset 93821:31875b244bdf 3.4

Issue #23006: Improve the documentation and indexing of dict.__missing__. Add an entry in the language datamodel special methods section. Revise and index its discussion in the stdtypes mapping/dict section. [#23006]

Terry Jan Reedy tjreedy@udel.edu
date Wed, 10 Dec 2014 18:38:19 -0500
parents d04dab84388f
children dd5491705e5f 41b172fd4479
files Doc/library/stdtypes.rst Doc/reference/datamodel.rst Misc/NEWS
diffstat 3 files changed, 18 insertions(+), 5 deletions(-)[+] [-] Doc/library/stdtypes.rst 13 Doc/reference/datamodel.rst 6 Misc/NEWS 4

line wrap: on

line diff

--- a/Doc/library/stdtypes.rst +++ b/Doc/library/stdtypes.rst @@ -3761,11 +3761,13 @@ pairs within braces, for example: ``{'ja Return the item of d with key key. Raises a :exc:KeyError if key is not in the map.

+

@@ -3779,8 +3781,9 @@ pairs within braces, for example: ``{'ja >>> c['red'] 1

.. describe:: d[key] = value

--- a/Doc/reference/datamodel.rst +++ b/Doc/reference/datamodel.rst @@ -1904,6 +1904,12 @@ through the container; for mappings, :me indexes to allow proper detection of the end of the sequence. +.. method:: object.missing(self, key) +

+ .. method:: object.setitem(self, key, value) Called to implement assignment to self[key]. Same note as for

--- a/Misc/NEWS +++ b/Misc/NEWS @@ -9474,6 +9474,10 @@ C-API Documentation ------------- +- Issue #23006: Improve the documentation and indexing of dict.missing.