Author: Ronan Lamy <[email protected]>
Branch: PyBuffer
Changeset: r91045:96ffa9bf2352
Date: 2017-04-12 18:06 +0100
http://bitbucket.org/pypy/pypy/changeset/96ffa9bf2352/

Log:    Rename Buffer to PyBuffer

diff --git a/pypy/interpreter/buffer.py b/pypy/interpreter/buffer.py
--- a/pypy/interpreter/buffer.py
+++ b/pypy/interpreter/buffer.py
@@ -6,7 +6,7 @@
 from pypy.interpreter.error import oefmt
 
 
-class Buffer(object):
+class PyBuffer(object):
     """Abstract base class for buffers."""
     _attrs_ = ['readonly']
     _immutable_ = True
@@ -186,7 +186,7 @@
         return space.newlist(items)
 
 
-class SimpleBuffer(Buffer):
+class SimpleBuffer(PyBuffer):
     _attrs_ = ['readonly', 'data']
     _immutable_ = True
 
diff --git a/pypy/module/array/interp_array.py 
b/pypy/module/array/interp_array.py
--- a/pypy/module/array/interp_array.py
+++ b/pypy/module/array/interp_array.py
@@ -6,7 +6,7 @@
 from rpython.rtyper.lltypesystem import lltype, rffi
 from rpython.rtyper.lltypesystem.rstr import copy_string_to_raw
 
-from pypy.interpreter.buffer import Buffer, BinaryBuffer
+from pypy.interpreter.buffer import PyBuffer, BinaryBuffer
 from pypy.interpreter.baseobjspace import W_Root
 from pypy.interpreter.error import OperationError, oefmt
 from pypy.interpreter.gateway import (
@@ -882,7 +882,7 @@
         return self.w_array._charbuf_start()
 
 
-class ArrayBuffer(Buffer):
+class ArrayBuffer(PyBuffer):
     _immutable_ = True
 
     def __init__(self, data, fmt, itemsize, readonly):
diff --git a/pypy/module/cpyext/slotdefs.py b/pypy/module/cpyext/slotdefs.py
--- a/pypy/module/cpyext/slotdefs.py
+++ b/pypy/module/cpyext/slotdefs.py
@@ -19,7 +19,7 @@
 from pypy.module.cpyext.memoryobject import fill_Py_buffer
 from pypy.module.cpyext.state import State
 from pypy.module.cpyext import userslot
-from pypy.interpreter.buffer import Buffer
+from pypy.interpreter.buffer import PyBuffer
 from pypy.interpreter.error import OperationError, oefmt
 from pypy.interpreter.argument import Arguments
 from rpython.rlib.unroll import unrolling_iterable
@@ -313,7 +313,7 @@
         space.fromcache(State).check_and_raise_exception(always=True)
     return space.newint(res)
 
-class CPyBuffer(Buffer):
+class CPyBuffer(PyBuffer):
     # Similar to Py_buffer
     _immutable_ = True
 
diff --git a/pypy/module/micronumpy/concrete.py 
b/pypy/module/micronumpy/concrete.py
--- a/pypy/module/micronumpy/concrete.py
+++ b/pypy/module/micronumpy/concrete.py
@@ -1,4 +1,4 @@
-from pypy.interpreter.buffer import Buffer
+from pypy.interpreter.buffer import PyBuffer
 from pypy.interpreter.error import oefmt
 from rpython.rlib import jit, rgc
 from rpython.rlib.rarithmetic import ovfcheck
@@ -702,7 +702,7 @@
         free_raw_storage(self.storage)
 
 
-class ArrayBuffer(Buffer):
+class ArrayBuffer(PyBuffer):
     _immutable_ = True
 
     def __init__(self, impl, readonly):
diff --git a/pypy/objspace/std/memoryobject.py 
b/pypy/objspace/std/memoryobject.py
--- a/pypy/objspace/std/memoryobject.py
+++ b/pypy/objspace/std/memoryobject.py
@@ -1,11 +1,11 @@
 """
-Implementation of the 'buffer' and 'memoryview' types.
+Implementation of the 'memoryview' type.
 """
 import operator
 
 from rpython.rlib.objectmodel import compute_hash
 from pypy.interpreter.baseobjspace import W_Root
-from pypy.interpreter.buffer import Buffer, SubBuffer
+from pypy.interpreter.buffer import PyBuffer, SubBuffer
 from pypy.interpreter.error import OperationError, oefmt
 from pypy.interpreter.gateway import interp2app
 from pypy.interpreter.typedef import TypeDef, GetSetProperty,  
make_weakref_descr
@@ -27,7 +27,7 @@
     """
 
     def __init__(self, buf):
-        assert isinstance(buf, Buffer)
+        assert isinstance(buf, PyBuffer)
         self.buf = buf
         self._hash = -1
         self.flags = 0
@@ -347,7 +347,7 @@
         return size
 
     def _zero_in_shape(self):
-        # this method could be moved to the class Buffer
+        # this method could be moved to the class PyBuffer
         buf = self.buf
         shape = buf.getshape()
         for i in range(buf.getndim()):
@@ -590,7 +590,7 @@
                 _IsFortranContiguous(ndim, shape, strides, itemsize))
     return 0
 
-class BufferSlice(Buffer):
+class BufferSlice(PyBuffer):
     _immutable_ = True
     _attrs_ = ['buf', 'readonly', 'shape', 'strides', 'offset', 'step']
     def __init__(self, buf, start, step, length):
@@ -650,7 +650,7 @@
         return self.buf.setitem_w(space, self.parent_index(idx), w_obj)
 
 
-class BufferViewBase(Buffer):
+class BufferViewBase(PyBuffer):
     _immutable_ = True
     _attrs_ = ['readonly', 'parent']
 
diff --git a/pypy/objspace/std/test/test_memoryobject.py 
b/pypy/objspace/std/test/test_memoryobject.py
--- a/pypy/objspace/std/test/test_memoryobject.py
+++ b/pypy/objspace/std/test/test_memoryobject.py
@@ -4,7 +4,7 @@
 from pypy.interpreter.baseobjspace import W_Root
 from pypy.interpreter.gateway import interp2app
 from pypy.interpreter.typedef import TypeDef
-from pypy.interpreter.buffer import Buffer
+from pypy.interpreter.buffer import PyBuffer
 from pypy.conftest import option
 
 class AppTestMemoryView:
@@ -292,7 +292,7 @@
         assert (m[0], m[1], m[2], m[3]) == expected
         a.free()
 
-class MockBuffer(Buffer):
+class MockBuffer(PyBuffer):
     def __init__(self, space, w_arr, w_dim, w_fmt, \
                  w_itemsize, w_strides, w_shape):
         self.space = space
diff --git a/pypy/objspace/std/unicodeobject.py 
b/pypy/objspace/std/unicodeobject.py
--- a/pypy/objspace/std/unicodeobject.py
+++ b/pypy/objspace/std/unicodeobject.py
@@ -12,7 +12,6 @@
 
 from pypy.interpreter import unicodehelper
 from pypy.interpreter.baseobjspace import W_Root
-from pypy.interpreter.buffer import StringBuffer
 from pypy.interpreter.error import OperationError, oefmt
 from pypy.interpreter.gateway import WrappedDefault, interp2app, unwrap_spec
 from pypy.interpreter.typedef import TypeDef
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to