Author: Carl Friedrich Bolz-Tereick <[email protected]>
Branch:
Changeset: r94639:731e015261b7
Date: 2018-05-21 16:06 +0200
http://bitbucket.org/pypy/pypy/changeset/731e015261b7/
Log: Backed out changeset bf0a01ba0389
diff --git a/pypy/interpreter/astcompiler/ast.py
b/pypy/interpreter/astcompiler/ast.py
--- a/pypy/interpreter/astcompiler/ast.py
+++ b/pypy/interpreter/astcompiler/ast.py
@@ -39,9 +39,6 @@
def mutate_over(self, visitor):
raise AssertionError("mutate_over() implementation not provided")
- def to_object(self, space):
- raise NotImplementedError("abstract base class")
-
class NodeVisitorNotImplemented(Exception):
pass
diff --git a/pypy/interpreter/astcompiler/tools/asdl_py.py
b/pypy/interpreter/astcompiler/tools/asdl_py.py
--- a/pypy/interpreter/astcompiler/tools/asdl_py.py
+++ b/pypy/interpreter/astcompiler/tools/asdl_py.py
@@ -435,9 +435,6 @@
def mutate_over(self, visitor):
raise AssertionError("mutate_over() implementation not provided")
- def to_object(self, space):
- raise NotImplementedError("abstract base class")
-
class NodeVisitorNotImplemented(Exception):
pass
diff --git a/pypy/interpreter/baseobjspace.py b/pypy/interpreter/baseobjspace.py
--- a/pypy/interpreter/baseobjspace.py
+++ b/pypy/interpreter/baseobjspace.py
@@ -33,7 +33,6 @@
__slots__ = ('__weakref__',)
_must_be_light_finalizer_ = True
user_overridden_class = False
- _settled_ = True
def getdict(self, space):
return None
@@ -198,8 +197,6 @@
# hooks that the mapdict implementations needs:
def _get_mapdict_map(self):
return None
- def _mapdict_init_empty(self, terminator):
- return None
def _set_mapdict_map(self, map):
raise NotImplementedError
def _mapdict_read_storage(self, index):
@@ -916,11 +913,9 @@
"""Unpack an iterable into a real (interpreter-level) list.
Raise an OperationError(w_ValueError) if the length is wrong."""
- from pypy.interpreter.generator import GeneratorIterator
w_iterator = self.iter(w_iterable)
if expected_length == -1:
if self.is_generator(w_iterator):
- assert isinstance(w_iterator, GeneratorIterator)
# special hack for speed
lst_w = []
w_iterator.unpack_into(lst_w)
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
@@ -301,7 +301,6 @@
"""
strategy = self.get_strategy()
strategy.move_to_end(self, w_key, last_flag)
- # XXX this should be in the default move_to_end method!
def nondescr_popitem_first(self, space):
"""Not exposed directly to app-level, but via __pypy__.popitem_first().
@@ -499,9 +498,6 @@
def get_empty_storage(self):
raise NotImplementedError
- def switch_to_object_strategy(self, w_dict):
- raise NotImplementedError
-
@jit.look_inside_iff(lambda self, w_dict:
w_dict_unrolling_heuristic(w_dict))
def w_keys(self, w_dict):
@@ -588,36 +584,6 @@
def prepare_update(self, w_dict, num_extra):
pass
- def length(self, w_dict):
- raise NotImplementedError
-
- def getitem(self, w_dict, w_key):
- raise NotImplementedError
-
- def getitem_str(self, w_dict, key):
- raise NotImplementedError
-
- def setitem(self, w_dict, w_key, w_value):
- raise NotImplementedError
-
- def setitem_str(self, w_dict, key, w_value):
- raise NotImplementedError
-
- def delitem(self, w_dict, w_key):
- raise NotImplementedError
-
- def setdefault(self, w_dict, w_key, w_default):
- raise NotImplementedError
-
- def iterkeys(self, w_dict):
- raise NotImplementedError
-
- def itervalues(self, w_dict):
- raise NotImplementedError
-
- def iteritems(self, w_dict):
- raise NotImplementedError
-
def move_to_end(self, w_dict, w_key, last_flag):
# fall-back
w_value = w_dict.getitem(w_key)
@@ -841,22 +807,12 @@
class BaseKeyIterator(BaseIteratorImplementation):
next_key = _new_next('key')
- def next_key_entry(self):
- raise NotImplementedError
-
-
class BaseValueIterator(BaseIteratorImplementation):
next_value = _new_next('value')
- def next_value_entry(self):
- raise NotImplementedError
-
class BaseItemIterator(BaseIteratorImplementation):
next_item = _new_next('item')
- def next_item_entry(self):
- raise NotImplementedError
-
def create_iterator_classes(dictimpl):
if not hasattr(dictimpl, 'wrapkey'):
@@ -1491,7 +1447,6 @@
class W_DictMultiIterKeysObject(W_BaseDictMultiIterObject):
def descr_next(self, space):
iteratorimplementation = self.iteratorimplementation
- assert isinstance(iteratorimplementation, BaseKeyIterator)
w_key = iteratorimplementation.next_key()
if w_key is not None:
return w_key
@@ -1500,7 +1455,6 @@
class W_DictMultiIterValuesObject(W_BaseDictMultiIterObject):
def descr_next(self, space):
iteratorimplementation = self.iteratorimplementation
- assert isinstance(iteratorimplementation, BaseValueIterator)
w_value = iteratorimplementation.next_value()
if w_value is not None:
return w_value
@@ -1509,7 +1463,6 @@
class W_DictMultiIterItemsObject(W_BaseDictMultiIterObject):
def descr_next(self, space):
iteratorimplementation = self.iteratorimplementation
- assert isinstance(iteratorimplementation, BaseItemIterator)
w_key, w_value = iteratorimplementation.next_item()
if w_key is not None:
return space.newtuple([w_key, w_value])
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
@@ -808,9 +808,6 @@
def getitems(self, w_list):
return self.getitems_copy(w_list)
- def getitems_fixedsize(self, w_list):
- raise NotImplementedError
-
def getitems_copy(self, w_list):
raise NotImplementedError
@@ -859,13 +856,11 @@
raise NotImplementedError
def extend(self, w_list, w_any):
- from pypy.interpreter.generator import GeneratorIterator
space = self.space
if type(w_any) is W_ListObject or (isinstance(w_any, W_ListObject) and
space._uses_list_iter(w_any)):
self._extend_from_list(w_list, w_any)
elif space.is_generator(w_any):
- assert isinstance(w_any, GeneratorIterator)
w_any.unpack_into_w(w_list)
else:
self._extend_from_iterable(w_list, w_any)
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit