Author: Ronan Lamy <ronan.l...@gmail.com>
Branch: py3k
Changeset: r85451:f44a76b03795
Date: 2016-06-29 16:34 +0100
http://bitbucket.org/pypy/pypy/changeset/f44a76b03795/

Log:    Rename wrapbytes to newbytes, for consistency with newint, newfloat,
        etc.

diff --git a/pypy/objspace/std/bytesobject.py b/pypy/objspace/std/bytesobject.py
--- a/pypy/objspace/std/bytesobject.py
+++ b/pypy/objspace/std/bytesobject.py
@@ -657,10 +657,6 @@
 W_BytesObject.EMPTY = W_BytesObject('')
 
 
-def wrapstr(space, s):
-    return W_BytesObject(s)
-
-
 def getbytevalue(space, w_value):
     value = space.getindex_w(w_value, None)
     if not 0 <= value < 256:
diff --git a/pypy/objspace/std/objspace.py b/pypy/objspace/std/objspace.py
--- a/pypy/objspace/std/objspace.py
+++ b/pypy/objspace/std/objspace.py
@@ -16,7 +16,7 @@
 # Object imports
 from pypy.objspace.std.boolobject import W_BoolObject
 from pypy.objspace.std.bytearrayobject import W_BytearrayObject
-from pypy.objspace.std.bytesobject import W_AbstractBytesObject, 
W_BytesObject, wrapstr
+from pypy.objspace.std.bytesobject import W_AbstractBytesObject, W_BytesObject
 from pypy.objspace.std.complexobject import W_ComplexObject
 from pypy.objspace.std.dictmultiobject import W_DictMultiObject, W_DictObject
 from pypy.objspace.std.floatobject import W_FloatObject
@@ -129,9 +129,6 @@
         assert typedef is not None
         return self.fromcache(TypeCache).getorbuild(typedef)
 
-    def wrapbytes(self, x):
-        return wrapstr(self, x)
-
     @specialize.argtype(1)
     def wrap(self, x):
         "Wraps the Python value 'x' into one of the wrapper classes."
@@ -341,6 +338,10 @@
     def newbuffer(self, w_obj):
         return W_MemoryView(w_obj)
 
+    def newbytes(self, s):
+        return W_BytesObject(s)
+    wrapbytes = newbytes
+
     def type(self, w_obj):
         jit.promote(w_obj.__class__)
         return w_obj.getclass(self)
_______________________________________________
pypy-commit mailing list
pypy-commit@python.org
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to