[pypy-commit] pypy py2-mappingproxy: Cleanup
rlamy
pypy.commits at gmail.com
Tue Aug 9 10:52:47 EDT 2016
Author: Ronan Lamy <ronan.lamy at gmail.com>
Branch: py2-mappingproxy
Changeset: r86115:9d629ea0f59c
Date: 2016-08-08 18:45 +0100
http://bitbucket.org/pypy/pypy/changeset/9d629ea0f59c/
Log: Cleanup
diff --git a/pypy/objspace/std/classdict.py b/pypy/objspace/std/classdict.py
--- a/pypy/objspace/std/classdict.py
+++ b/pypy/objspace/std/classdict.py
@@ -85,7 +85,8 @@
return space.newlist_bytes(self.unerase(w_dict.dstorage).dict_w.keys())
def values(self, w_dict):
- return [unwrap_cell(self.space, w_value) for w_value in self.unerase(w_dict.dstorage).dict_w.itervalues()]
+ return [unwrap_cell(self.space, w_value) for w_value in
+ self.unerase(w_dict.dstorage).dict_w.itervalues()]
def items(self, w_dict):
space = self.space
@@ -103,12 +104,16 @@
def getiterkeys(self, w_dict):
return self.unerase(w_dict.dstorage).dict_w.iterkeys()
+
def getitervalues(self, w_dict):
return self.unerase(w_dict.dstorage).dict_w.itervalues()
+
def getiteritems_with_hash(self, w_dict):
return iteritems_with_hash(self.unerase(w_dict.dstorage).dict_w)
+
def wrapkey(space, key):
return space.wrap(key)
+
def wrapvalue(space, value):
return unwrap_cell(space, value)
diff --git a/pypy/objspace/std/dictproxyobject.py b/pypy/objspace/std/dictproxyobject.py
--- a/pypy/objspace/std/dictproxyobject.py
+++ b/pypy/objspace/std/dictproxyobject.py
@@ -1,5 +1,8 @@
-# Read-only proxy for mappings. PyPy does not have a separate type for
-# type.__dict__, so PyDictProxy_New has to use a custom read-only mapping.
+"""
+Read-only proxy for mappings.
+
+Its main use is as the return type of cls.__dict__.
+"""
from pypy.interpreter.baseobjspace import W_Root
from pypy.interpreter.error import oefmt
More information about the pypy-commit
mailing list