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
3170d1cc
Commit
3170d1cc
authored
May 03, 2014
by
Raymond Hettinger
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue #21421: Add __slots__ to the MappingViews ABCs.
parent
90e93383
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
0 deletions
+11
-0
Lib/_collections_abc.py
Lib/_collections_abc.py
+8
-0
Misc/NEWS
Misc/NEWS
+3
-0
No files found.
Lib/_collections_abc.py
View file @
3170d1cc
...
...
@@ -440,6 +440,8 @@ Mapping.register(mappingproxy)
class
MappingView
(
Sized
):
__slots__
=
'_mapping'
,
def
__init__
(
self
,
mapping
):
self
.
_mapping
=
mapping
...
...
@@ -452,6 +454,8 @@ class MappingView(Sized):
class
KeysView
(
MappingView
,
Set
):
__slots__
=
()
@
classmethod
def
_from_iterable
(
self
,
it
):
return
set
(
it
)
...
...
@@ -467,6 +471,8 @@ KeysView.register(dict_keys)
class
ItemsView
(
MappingView
,
Set
):
__slots__
=
()
@
classmethod
def
_from_iterable
(
self
,
it
):
return
set
(
it
)
...
...
@@ -489,6 +495,8 @@ ItemsView.register(dict_items)
class
ValuesView
(
MappingView
):
__slots__
=
()
def
__contains__
(
self
,
value
):
for
key
in
self
.
_mapping
:
if
value
==
self
.
_mapping
[
key
]:
...
...
Misc/NEWS
View file @
3170d1cc
...
...
@@ -73,6 +73,9 @@ Library
Decimal.quantize() method in the Python version. It had never been
present in the C version.
- Issue #21421: Add __slots__ to the MappingViews ABC.
Patch by Josh Rosenberg.
- Issue #21101: Eliminate double hashing in the C speed-up code for
collections.Counter().
...
...
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