Breaking ground for PEP 3137 implementation:

Get rid of buffer().  Use memoryview() in its place where possible.
In a few places, do things a bit different, because memoryview()
can't slice (yet).
diff --git a/Lib/sqlite3/test/userfunctions.py b/Lib/sqlite3/test/userfunctions.py
index ab4f756..994057e 100644
--- a/Lib/sqlite3/test/userfunctions.py
+++ b/Lib/sqlite3/test/userfunctions.py
@@ -36,7 +36,7 @@
 def func_returnnull():
     return None
 def func_returnblob():
-    return buffer(b"blob")
+    return b"blob"
 def func_raiseexception():
     5/0
 
@@ -49,7 +49,7 @@
 def func_isnone(v):
     return type(v) is type(None)
 def func_isblob(v):
-    return type(v) is buffer
+    return isinstance(v, (bytes, memoryview))
 
 class AggrNoStep:
     def __init__(self):
@@ -100,7 +100,8 @@
         self.val = None
 
     def step(self, whichType, val):
-        theType = {"str": str, "int": int, "float": float, "None": type(None), "blob": buffer}
+        theType = {"str": str, "int": int, "float": float, "None": type(None),
+                   "blob": bytes}
         self.val = int(theType[whichType] is type(val))
 
     def finalize(self):
@@ -196,8 +197,8 @@
         cur = self.con.cursor()
         cur.execute("select returnblob()")
         val = cur.fetchone()[0]
-        self.failUnlessEqual(type(val), buffer)
-        self.failUnlessEqual(val, buffer(b"blob"))
+        self.failUnlessEqual(type(val), bytes)
+        self.failUnlessEqual(val, memoryview(b"blob"))
 
     def CheckFuncException(self):
         cur = self.con.cursor()
@@ -234,7 +235,7 @@
 
     def CheckParamBlob(self):
         cur = self.con.cursor()
-        cur.execute("select isblob(?)", (buffer(b"blob"),))
+        cur.execute("select isblob(?)", (memoryview(b"blob"),))
         val = cur.fetchone()[0]
         self.failUnlessEqual(val, 1)
 
@@ -252,7 +253,7 @@
                 )
             """)
         cur.execute("insert into test(t, i, f, n, b) values (?, ?, ?, ?, ?)",
-            ("foo", 5, 3.14, None, buffer(b"blob"),))
+            ("foo", 5, 3.14, None, memoryview(b"blob"),))
 
         self.con.create_aggregate("nostep", 1, AggrNoStep)
         self.con.create_aggregate("nofinalize", 1, AggrNoFinalize)
@@ -344,7 +345,7 @@
 
     def CheckAggrCheckParamBlob(self):
         cur = self.con.cursor()
-        cur.execute("select checkType('blob', ?)", (buffer(b"blob"),))
+        cur.execute("select checkType('blob', ?)", (memoryview(b"blob"),))
         val = cur.fetchone()[0]
         self.failUnlessEqual(val, 1)