Author: Carl Friedrich Bolz-Tereick <[email protected]>
Branch: unicode-utf8-py3
Changeset: r95627:59c5294dfb36
Date: 2019-01-13 15:08 +0100
http://bitbucket.org/pypy/pypy/changeset/59c5294dfb36/
Log: merge heads
diff --git a/pypy/objspace/std/dictmultiobject.py
b/pypy/objspace/std/dictmultiobject.py
--- a/pypy/objspace/std/dictmultiobject.py
+++ b/pypy/objspace/std/dictmultiobject.py
@@ -122,17 +122,11 @@
if w_fill is None:
w_fill = space.w_None
if space.is_w(w_type, space.w_dict):
- ulist = space.listview_utf8(w_keys)
- if ulist is not None:
- strategy = space.fromcache(UnicodeDictStrategy)
- storage = strategy.get_storage_fromkeys(ulist, w_fill)
- w_dict = space.allocate_instance(W_DictObject, w_type)
- W_DictObject.__init__(w_dict, space, strategy, storage)
- else:
- w_dict = W_DictMultiObject.allocate_and_init_instance(space,
- w_type)
- for w_key in space.listview(w_keys):
- w_dict.setitem(w_key, w_fill)
+ # XXX consider re-enabling a fast-path here
+ w_dict = W_DictMultiObject.allocate_and_init_instance(space,
+ w_type)
+ for w_key in space.listview(w_keys):
+ w_dict.setitem(w_key, w_fill)
else:
w_dict = space.call_function(w_type)
for w_key in space.listview(w_keys):
@@ -1217,14 +1211,6 @@
i += 1
return keys, values
- def get_storage_fromkeys(self, keys_w, w_fill):
- """Return an initialized storage with keys and fill values"""
- storage = {}
- mark_dict_non_null(storage)
- for key in keys_w:
- storage[key] = w_fill
- return self.erase(storage)
-
create_iterator_classes(UnicodeDictStrategy)
diff --git a/pypy/objspace/std/test/test_dictmultiobject.py
b/pypy/objspace/std/test/test_dictmultiobject.py
--- a/pypy/objspace/std/test/test_dictmultiobject.py
+++ b/pypy/objspace/std/test/test_dictmultiobject.py
@@ -125,6 +125,7 @@
assert self.space.eq_w(space.call_function(get, w("33"), w(44)), w(44))
def test_fromkeys_fastpath(self):
+ py.test.skip("doesn't make sense here")
space = self.space
w = space.wrap
@@ -1190,7 +1191,6 @@
assert d["ä"] == 2
def test_empty_to_int(self):
- skip('IntDictStrategy is disabled for now, re-enable it!')
import sys
d = {}
d[1] = "hi"
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit