ยปCore Development>Code coverage>Doc/includes/sqlite3/adapter_point_2.py

Python code coverage for Doc/includes/sqlite3/adapter_point_2.py

#countcontent
1n/aimport sqlite3
2n/a
3n/aclass Point:
4n/a def __init__(self, x, y):
5n/a self.x, self.y = x, y
6n/a
7n/adef adapt_point(point):
8n/a return "%f;%f" % (point.x, point.y)
9n/a
10n/asqlite3.register_adapter(Point, adapt_point)
11n/a
12n/acon = sqlite3.connect(":memory:")
13n/acur = con.cursor()
14n/a
15n/ap = Point(4.0, -3.2)
16n/acur.execute("select ?", (p,))
17n/aprint(cur.fetchone()[0])