Author: Armin Rigo <ar...@tunes.org> Branch: py3.5 Changeset: r87840:29927b3fdb5a Date: 2016-10-17 14:57 +0200 http://bitbucket.org/pypy/pypy/changeset/29927b3fdb5a/
Log: Remove confusion created by an unnecessary specialize.argtype(0) diff --git a/pypy/interpreter/baseobjspace.py b/pypy/interpreter/baseobjspace.py --- a/pypy/interpreter/baseobjspace.py +++ b/pypy/interpreter/baseobjspace.py @@ -25,8 +25,6 @@ reds=['items', 'w_iterator']) -# It seems there's no way to do it without top-level-functions. - @specialize.memo() def _does_override_buffer_w(type): return type.buffer_w != W_Root.buffer_w @@ -35,18 +33,6 @@ def _does_override_buffer_w_ex(type): return type.buffer_w_ex != W_Root.buffer_w_ex -@specialize.argtype(0) -def W_Root_buffer_w(self, space, flags): - if _does_override_buffer_w_ex(self.__class__): - return self.buffer_w_ex(space, flags)[0] - return self._buffer(space, flags).buffer_w(space, flags) - -@specialize.argtype(0) -def W_Root_buffer_w_ex(self, space, flags): - if _does_override_buffer_w(self.__class__): - return self.buffer_w(space, flags), 'B', 1 - return self._buffer(space, flags).buffer_w_ex(space, flags) - class W_Root(object): """This is the abstract root class of all wrapped objects that live @@ -229,10 +215,14 @@ return None def buffer_w(self, space, flags): - return W_Root_buffer_w(self, space, flags) + if _does_override_buffer_w_ex(self.__class__): + return self.buffer_w_ex(space, flags)[0] + return self._buffer(space, flags).buffer_w(space, flags) def buffer_w_ex(self, space, flags): - return W_Root_buffer_w_ex(self, space, flags) + if _does_override_buffer_w(self.__class__): + return self.buffer_w(space, flags), 'B', 1 + return self._buffer(space, flags).buffer_w_ex(space, flags) def _buffer(self, space, flags): w_impl = space.lookup(self, '__buffer__') _______________________________________________ pypy-commit mailing list pypy-commit@python.org https://mail.python.org/mailman/listinfo/pypy-commit