Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
1ce853f3
Commit
1ce853f3
authored
Dec 05, 2018
by
Andre Delfino
Committed by
Serhiy Storchaka
Dec 05, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move __missing__ after __delitem__ in Data model. (GH-10923)
parent
54fd4550
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
8 deletions
+8
-8
Doc/reference/datamodel.rst
Doc/reference/datamodel.rst
+8
-8
No files found.
Doc/reference/datamodel.rst
View file @
1ce853f3
...
@@ -2146,6 +2146,8 @@ through the container; for mappings, :meth:`__iter__` should be the same as
...
@@ -2146,6 +2146,8 @@ through the container; for mappings, :meth:`__iter__` should be the same as
.. versionadded:: 3.4
.. versionadded:: 3.4
.. index:: object: slice
.. note::
.. note::
Slicing is done exclusively with the following three methods. A call like ::
Slicing is done exclusively with the following three methods. A call like ::
...
@@ -2161,8 +2163,6 @@ through the container; for mappings, :meth:`__iter__` should be the same as
...
@@ -2161,8 +2163,6 @@ through the container; for mappings, :meth:`__iter__` should be the same as
.. method:: object.__getitem__(self, key)
.. method:: object.__getitem__(self, key)
.. index:: object: slice
Called to implement evaluation of ``self[key]``. For sequence types, the
Called to implement evaluation of ``self[key]``. For sequence types, the
accepted keys should be integers and slice objects. Note that the special
accepted keys should be integers and slice objects. Note that the special
interpretation of negative indexes (if the class wishes to emulate a sequence
interpretation of negative indexes (if the class wishes to emulate a sequence
...
@@ -2178,12 +2178,6 @@ through the container; for mappings, :meth:`__iter__` should be the same as
...
@@ -2178,12 +2178,6 @@ through the container; for mappings, :meth:`__iter__` should be the same as
indexes to allow proper detection of the end of the sequence.
indexes to allow proper detection of the end of the sequence.
.. method:: object.__missing__(self, key)
Called by :class:`dict`\ .\ :meth:`__getitem__` to implement ``self[key]`` for dict subclasses
when key is not in the dictionary.
.. method:: object.__setitem__(self, key, value)
.. method:: object.__setitem__(self, key, value)
Called to implement assignment to ``self[key]``. Same note as for
Called to implement assignment to ``self[key]``. Same note as for
...
@@ -2202,6 +2196,12 @@ through the container; for mappings, :meth:`__iter__` should be the same as
...
@@ -2202,6 +2196,12 @@ through the container; for mappings, :meth:`__iter__` should be the same as
values as for the :meth:`__getitem__` method.
values as for the :meth:`__getitem__` method.
.. method:: object.__missing__(self, key)
Called by :class:`dict`\ .\ :meth:`__getitem__` to implement ``self[key]`` for dict subclasses
when key is not in the dictionary.
.. method:: object.__iter__(self)
.. method:: object.__iter__(self)
This method is called when an iterator is required for a container. This method
This method is called when an iterator is required for a container. This method
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment