Author: Armin Rigo <[email protected]>
Branch:
Changeset: r84257:78a9d921802c
Date: 2016-05-06 10:27 +0200
http://bitbucket.org/pypy/pypy/changeset/78a9d921802c/
Log: comments
diff --git a/pypy/doc/whatsnew-head.rst b/pypy/doc/whatsnew-head.rst
--- a/pypy/doc/whatsnew-head.rst
+++ b/pypy/doc/whatsnew-head.rst
@@ -77,3 +77,5 @@
Add rgc.FinalizerQueue, documented in pypy/doc/discussion/finalizer-order.rst.
It is a more flexible way to make RPython finalizers.
+
+.. branch: unpacking-cpython-shortcut
diff --git a/pypy/objspace/std/objspace.py b/pypy/objspace/std/objspace.py
--- a/pypy/objspace/std/objspace.py
+++ b/pypy/objspace/std/objspace.py
@@ -483,6 +483,11 @@
return None
def view_as_kwargs(self, w_dict):
+ # Tries to return (keys_list, values_list), or (None, None) if
+ # it fails. It can fail on some dict implementations, so don't
+ # rely on it. For dict subclasses, though, it never fails;
+ # this emulates CPython's behavior which often won't call
+ # custom __iter__() or keys() methods in dict subclasses.
if isinstance(w_dict, W_DictObject):
return w_dict.view_as_kwargs()
return (None, None)
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit