diff options
Diffstat (limited to 'src/zope/proxy')
-rw-r--r-- | src/zope/proxy/__init__.py | 14 | ||||
-rw-r--r-- | src/zope/proxy/tests/test_proxy.py | 10 |
2 files changed, 1 insertions, 23 deletions
diff --git a/src/zope/proxy/__init__.py b/src/zope/proxy/__init__.py index 4303257..b2366ab 100644 --- a/src/zope/proxy/__init__.py +++ b/src/zope/proxy/__init__.py @@ -219,23 +219,9 @@ class AbstractPyProxyBase: def __len__(self): return len(self._wrapped) - def __getslice__(self, start, stop): - try: - getslice = type(self._wrapped).__getslice__ - except AttributeError: - return self.__getitem__(slice(start, stop)) - return getslice(self._wrapped, start, stop) - def __getitem__(self, key): return self._wrapped[key] - def __setslice__(self, start, stop, value): - try: - setslice = type(self._wrapped).__setslice__ - except AttributeError: - return self.__setitem__(slice(start, stop), value) - return setslice(self._wrapped, start, stop, value) - def __setitem__(self, key, value): self._wrapped[key] = value diff --git a/src/zope/proxy/tests/test_proxy.py b/src/zope/proxy/tests/test_proxy.py index 09bf3f9..7d0faba 100644 --- a/src/zope/proxy/tests/test_proxy.py +++ b/src/zope/proxy/tests/test_proxy.py @@ -310,8 +310,7 @@ class PyProxyBaseTestCase(unittest.TestCase): data = [1, 2] class DerivedList(list): - def __getslice__(self, start, stop): # pragma: no cover PY2 - return list.__getslice__(self, start, stop) + pass pList = self._makeOne(DerivedList(data)) @@ -326,9 +325,6 @@ class PyProxyBaseTestCase(unittest.TestCase): def __len__(self): return 2 - def __getslice__(self, start, end): # pragma: no cover PY2 - return (start, end) - def __getitem__(self, a_slice): # On Python 3, we basically just return what the test expects. # Mostly that's the computed indices (yay!) but there are @@ -369,8 +365,6 @@ class PyProxyBaseTestCase(unittest.TestCase): def __getitem__(self, x): raise Missing('__getitem__') - def __getslice__(self, start, stop): # pragma: no cover PY2 - raise Missing("__getslice__") target = Get() proxy = self._makeOne(target) with self.assertRaisesRegex(Missing, self.getslice): @@ -411,8 +405,6 @@ class PyProxyBaseTestCase(unittest.TestCase): def __setitem__(self, k, v): raise Missing('__setitem__') - def __setslice__(self, start, stop, value): # pragma: no cover PY2 - raise Missing("__setslice__") target = Set() proxy = self._makeOne(target) with self.assertRaisesRegex(Missing, self.setslice): |