summaryrefslogtreecommitdiffstats
path: root/Doc/includes/sqlite3/converter_point.py
diff options
context:
space:
mode:
Diffstat (limited to 'Doc/includes/sqlite3/converter_point.py')
-rw-r--r--Doc/includes/sqlite3/converter_point.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/Doc/includes/sqlite3/converter_point.py b/Doc/includes/sqlite3/converter_point.py
index 5df828e..e220e9b 100644
--- a/Doc/includes/sqlite3/converter_point.py
+++ b/Doc/includes/sqlite3/converter_point.py
@@ -1,6 +1,6 @@
import sqlite3
-class Point:
+class Point(object):
def __init__(self, x, y):
self.x, self.y = x, y
@@ -8,10 +8,10 @@ class Point:
return "(%f;%f)" % (self.x, self.y)
def adapt_point(point):
- return ("%f;%f" % (point.x, point.y)).encode('ascii')
+ return "%f;%f" % (point.x, point.y)
def convert_point(s):
- x, y = list(map(float, s.split(b";")))
+ x, y = map(float, s.split(";"))
return Point(x, y)
# Register the adapter
@@ -30,7 +30,7 @@ cur.execute("create table test(p point)")
cur.execute("insert into test(p) values (?)", (p,))
cur.execute("select p from test")
-print("with declared types:", cur.fetchone()[0])
+print "with declared types:", cur.fetchone()[0]
cur.close()
con.close()
@@ -42,6 +42,6 @@ cur.execute("create table test(p)")
cur.execute("insert into test(p) values (?)", (p,))
cur.execute('select p as "p [point]" from test')
-print("with column names:", cur.fetchone()[0])
+print "with column names:", cur.fetchone()[0]
cur.close()
con.close()