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
f74cf77c
Commit
f74cf77c
authored
Oct 15, 2010
by
Georg Brandl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
#7771: reference to documentation of dictview methods and operations.
parent
1f7fffb3
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
28 deletions
+7
-28
Doc/library/stdtypes.rst
Doc/library/stdtypes.rst
+7
-28
No files found.
Doc/library/stdtypes.rst
View file @
f74cf77c
...
@@ -2208,34 +2208,11 @@ support membership tests:
...
@@ -2208,34 +2208,11 @@ support membership tests:
Keys views are set-like since their entries are unique and hashable. If all
Keys views are set-like since their entries are unique and hashable. If all
values are hashable, so that (key, value) pairs are unique and hashable, then
values are hashable, so that ``(key, value)`` pairs are unique and hashable,
the items view is also set-like. (Values views are not treated as set-like
then the items view is also set-like. (Values views are not treated as set-like
since the entries are generally not unique.) Then these set operations are
since the entries are generally not unique.) For set-like views, all of the
available ("other" refers either to another view or a set):
operations defined for the abstract base class :class:`collections.Set` are
available (for example, ``==``, ``<``, or ``^``).
.. describe:: dictview & other
Return the intersection of the dictview and the other object as a new set.
.. describe:: dictview | other
Return the union of the dictview and the other object as a new set.
.. describe:: dictview - other
Return the difference between the dictview and the other object (all elements
in *dictview* that aren't in *other*) as a new set.
.. describe:: dictview ^ other
Return the symmetric difference (all elements either in *dictview* or
*other*, but not in both) of the dictview and the other object as a new set.
.. method:: dictview.isdisjoint(other)
Return True if the view has no elements in common with *other*. Sets are
disjoint if and only if their intersection is the empty set.
An example of dictionary view usage::
An example of dictionary view usage::
...
@@ -2265,6 +2242,8 @@ An example of dictionary view usage::
...
@@ -2265,6 +2242,8 @@ An example of dictionary view usage::
>>> # set operations
>>> # set operations
>>> keys & {'eggs', 'bacon', 'salad'}
>>> keys & {'eggs', 'bacon', 'salad'}
{'bacon'}
{'bacon'}
>>> keys ^ {'sausage', 'juice'}
{'juice', 'eggs', 'bacon', 'spam'}
.. _typememoryview:
.. _typememoryview:
...
...
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