Author: Carl Friedrich Bolz-Tereick <[email protected]>
Branch:
Changeset: r94638:eef354dfdba8
Date: 2018-05-21 16:06 +0200
http://bitbucket.org/pypy/pypy/changeset/eef354dfdba8/
Log: Backed out changeset f0f9cfefd069
diff --git a/pypy/objspace/std/listobject.py b/pypy/objspace/std/listobject.py
--- a/pypy/objspace/std/listobject.py
+++ b/pypy/objspace/std/listobject.py
@@ -769,9 +769,6 @@
def __init__(self, space):
self.space = space
- def get_empty_storage(self, sizehint):
- raise NotImplementedError
-
def get_sizehint(self):
return -1
@@ -829,9 +826,6 @@
def getitems_float(self, w_list):
return None
- def getitems_unroll(self, w_list):
- raise NotImplementedError
-
def getstorage_copy(self, w_list):
raise NotImplementedError
@@ -1086,16 +1080,6 @@
strategy = w_list.strategy = self.space.fromcache(IntegerListStrategy)
w_list.lstorage = strategy.erase(items)
- def step(self, w_list):
- raise NotImplementedError
-
- def _getitems_range(self, w_list, wrap_items):
- raise NotImplementedError
- _getitems_range_unroll = _getitems_range
-
- def _getitem_range_unwrapped(self, w_list, i):
- raise NotImplementedError
-
def wrap(self, intval):
return self.space.newint(intval)
@@ -1120,7 +1104,7 @@
w_other.lstorage = w_list.lstorage
def getitem(self, w_list, i):
- return self.wrap(self._getitem_range_unwrapped(w_list, i))
+ return self.wrap(self._getitem_unwrapped(w_list, i))
def getitems_int(self, w_list):
return self._getitems_range(w_list, False)
@@ -1210,7 +1194,7 @@
def step(self, w_list):
return 1
- def _getitem_range_unwrapped(self, w_list, i):
+ def _getitem_unwrapped(self, w_list, i):
length = self.unerase(w_list.lstorage)[0]
if i < 0:
i += length
@@ -1288,7 +1272,7 @@
def step(self, w_list):
return self.unerase(w_list.lstorage)[1]
- def _getitem_range_unwrapped(self, w_list, i):
+ def _getitem_unwrapped(self, w_list, i):
v = self.unerase(w_list.lstorage)
start = v[0]
step = v[1]
diff --git a/pypy/objspace/std/setobject.py b/pypy/objspace/std/setobject.py
--- a/pypy/objspace/std/setobject.py
+++ b/pypy/objspace/std/setobject.py
@@ -31,9 +31,6 @@
reprlist = [repr(w_item) for w_item in self.getkeys()]
return "<%s(%s)(%s)>" % (self.__class__.__name__, self.strategy, ',
'.join(reprlist))
- def _newobj(self, space, w_iterable):
- raise NotImplementedError
-
def from_storage_and_strategy(self, storage, strategy):
obj = self._newobj(self.space, None)
assert isinstance(obj, W_BaseSetObject)
@@ -705,12 +702,6 @@
#def unerase(self, storage):
# raise NotImplementedError
- def may_contain_equal_elements(self, strategy):
- return True
-
- def _intersect_wrapped(self, w_set, w_other):
- raise NotImplementedError
-
# __________________ methods called on W_SetObject _________________
def clear(self, w_set):
@@ -1631,8 +1622,8 @@
if type(w_item) is not W_IntObject:
break
else:
- strategy = w_set.strategy = space.fromcache(IntegerSetStrategy)
- w_set.sstorage = strategy.get_storage_from_list(iterable_w)
+ w_set.strategy = space.fromcache(IntegerSetStrategy)
+ w_set.sstorage = w_set.strategy.get_storage_from_list(iterable_w)
return
# check for strings
@@ -1640,8 +1631,8 @@
if type(w_item) is not W_BytesObject:
break
else:
- strategy = w_set.strategy = space.fromcache(BytesSetStrategy)
- w_set.sstorage = strategy.get_storage_from_list(iterable_w)
+ w_set.strategy = space.fromcache(BytesSetStrategy)
+ w_set.sstorage = w_set.strategy.get_storage_from_list(iterable_w)
return
# check for unicode
@@ -1649,8 +1640,8 @@
if type(w_item) is not W_UnicodeObject:
break
else:
- strategy = w_set.strategy = space.fromcache(UnicodeSetStrategy)
- w_set.sstorage = strategy.get_storage_from_list(iterable_w)
+ w_set.strategy = space.fromcache(UnicodeSetStrategy)
+ w_set.sstorage = w_set.strategy.get_storage_from_list(iterable_w)
return
# check for compares by identity
@@ -1658,12 +1649,12 @@
if not space.type(w_item).compares_by_identity():
break
else:
- strategy = w_set.strategy = space.fromcache(IdentitySetStrategy)
- w_set.sstorage = strategy.get_storage_from_list(iterable_w)
+ w_set.strategy = space.fromcache(IdentitySetStrategy)
+ w_set.sstorage = w_set.strategy.get_storage_from_list(iterable_w)
return
- strategy = w_set.strategy = space.fromcache(ObjectSetStrategy)
- w_set.sstorage = strategy.get_storage_from_list(iterable_w)
+ w_set.strategy = space.fromcache(ObjectSetStrategy)
+ w_set.sstorage = w_set.strategy.get_storage_from_list(iterable_w)
create_set_driver = jit.JitDriver(name='create_set',
diff --git a/rpython/annotator/classdesc.py b/rpython/annotator/classdesc.py
--- a/rpython/annotator/classdesc.py
+++ b/rpython/annotator/classdesc.py
@@ -112,14 +112,10 @@
if not homedef.check_missing_attribute_update(attr):
for desc in s_newvalue.descriptions:
if desc.selfclassdef is None:
- print AnnotatorError(
+ raise AnnotatorError(
"demoting method %s from %s to class "
- "%s not allowed\n" % (self.name,
desc.originclassdef, homedef) +
- "either you need to add an abstract method
to the base class\n" +
- "or you need an assert isinstance(...) to
ensure the annotator " +
- "that the instance is of the right class"
+ "%s not allowed" % (self.name,
desc.originclassdef, homedef)
)
- break
# check for attributes forbidden by slots or _attrs_
if homedef.classdesc.all_enforced_attrs is not None:
diff --git a/rpython/memory/gc/inspector.py b/rpython/memory/gc/inspector.py
--- a/rpython/memory/gc/inspector.py
+++ b/rpython/memory/gc/inspector.py
@@ -103,9 +103,6 @@
self.seen = AddressDict()
self.pending = AddressStack()
- def processobj(self, obj):
- raise NotImplementedError("abstract base class")
-
def delete(self):
if self.gcflag == 0:
self.seen.delete()
diff --git a/rpython/rlib/buffer.py b/rpython/rlib/buffer.py
--- a/rpython/rlib/buffer.py
+++ b/rpython/rlib/buffer.py
@@ -57,9 +57,6 @@
"""Return the size in bytes."""
raise NotImplementedError
- def get_raw_address(self):
- raise NotImplementedError
-
def __len__(self):
res = self.getlength()
assert res >= 0
@@ -166,7 +163,7 @@
def decorate(targetcls):
"""
Create and attach specialized versions of typed_{read,write}. We need
to
- do this because the JIT codewriters mandates that base_ofs is an
+ do this becase the JIT codewriters mandates that base_ofs is an
RPython constant.
"""
if targetcls.__bases__ != (GCBuffer,):
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit