summaryrefslogtreecommitdiffstats
path: root/Doc/lib/sqlite3/adapter_point_2.py
diff options
context:
space:
mode:
Diffstat (limited to 'Doc/lib/sqlite3/adapter_point_2.py')
-rw-r--r--Doc/lib/sqlite3/adapter_point_2.py34
1 files changed, 17 insertions, 17 deletions
diff --git a/Doc/lib/sqlite3/adapter_point_2.py b/Doc/lib/sqlite3/adapter_point_2.py
index 50e3692..200a064 100644
--- a/Doc/lib/sqlite3/adapter_point_2.py
+++ b/Doc/lib/sqlite3/adapter_point_2.py
@@ -1,17 +1,17 @@
-import sqlite3
-
-class Point(object):
- def __init__(self, x, y):
- self.x, self.y = x, y
-
-def adapt_point(point):
- return "%f;%f" % (point.x, point.y)
-
-sqlite3.register_adapter(Point, adapt_point)
-
-con = sqlite3.connect(":memory:")
-cur = con.cursor()
-
-p = Point(4.0, -3.2)
-cur.execute("select ?", (p,))
-print cur.fetchone()[0]
+import sqlite3
+
+class Point(object):
+ def __init__(self, x, y):
+ self.x, self.y = x, y
+
+def adapt_point(point):
+ return "%f;%f" % (point.x, point.y)
+
+sqlite3.register_adapter(Point, adapt_point)
+
+con = sqlite3.connect(":memory:")
+cur = con.cursor()
+
+p = Point(4.0, -3.2)
+cur.execute("select ?", (p,))
+print cur.fetchone()[0]