Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
grumpy
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
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
grumpy
Commits
b872e4b1
Commit
b872e4b1
authored
Dec 21, 2016
by
Dylan Trotter
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove references to dict view and buffer classes since they are not yet implemented
parent
f050f222
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
50 additions
and
50 deletions
+50
-50
third_party/stdlib/_abcoll.py
third_party/stdlib/_abcoll.py
+50
-50
No files found.
third_party/stdlib/_abcoll.py
View file @
b872e4b1
...
...
@@ -442,55 +442,55 @@ class MappingView(Sized):
return
'{0.__class__.__name__}({0._mapping!r})'
.
format
(
self
)
class
KeysView
(
MappingView
,
Set
):
@
classmethod
def
_from_iterable
(
self
,
it
):
return
set
(
it
)
def
__contains__
(
self
,
key
):
return
key
in
self
.
_mapping
def
__iter__
(
self
):
for
key
in
self
.
_mapping
:
yield
key
KeysView
.
register
(
type
({}.
viewkeys
()))
class
ItemsView
(
MappingView
,
Set
):
@
classmethod
def
_from_iterable
(
self
,
it
):
return
set
(
it
)
def
__contains__
(
self
,
item
):
key
,
value
=
item
try
:
v
=
self
.
_mapping
[
key
]
except
KeyError
:
return
False
else
:
return
v
==
value
def
__iter__
(
self
):
for
key
in
self
.
_mapping
:
yield
(
key
,
self
.
_mapping
[
key
])
ItemsView
.
register
(
type
({}.
viewitems
()))
class
ValuesView
(
MappingView
):
def
__contains__
(
self
,
value
):
for
key
in
self
.
_mapping
:
if
value
==
self
.
_mapping
[
key
]:
return
True
return
False
def
__iter__
(
self
):
for
key
in
self
.
_mapping
:
yield
self
.
_mapping
[
key
]
ValuesView
.
register
(
type
({}.
viewvalues
()))
#
class KeysView(MappingView, Set):
#
#
@classmethod
#
def _from_iterable(self, it):
#
return set(it)
#
#
def __contains__(self, key):
#
return key in self._mapping
#
#
def __iter__(self):
#
for key in self._mapping:
#
yield key
#
#
KeysView.register(type({}.viewkeys()))
#
#
class ItemsView(MappingView, Set):
#
#
@classmethod
#
def _from_iterable(self, it):
#
return set(it)
#
#
def __contains__(self, item):
#
key, value = item
#
try:
#
v = self._mapping[key]
#
except KeyError:
#
return False
#
else:
#
return v == value
#
#
def __iter__(self):
#
for key in self._mapping:
#
yield (key, self._mapping[key])
#
#
ItemsView.register(type({}.viewitems()))
#
#
class ValuesView(MappingView):
#
#
def __contains__(self, value):
#
for key in self._mapping:
#
if value == self._mapping[key]:
#
return True
#
return False
#
#
def __iter__(self):
#
for key in self._mapping:
#
yield self._mapping[key]
#
#
ValuesView.register(type({}.viewvalues()))
class
MutableMapping
(
Mapping
):
...
...
@@ -635,7 +635,7 @@ class Sequence(Sized, Iterable, Container):
Sequence
.
register
(
tuple
)
Sequence
.
register
(
basestring
)
Sequence
.
register
(
buffer
)
#
Sequence.register(buffer)
Sequence
.
register
(
xrange
)
...
...
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