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

Python code coverage for Doc/includes/sqlite3/adapter_point_1.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/a def __conform__(self, protocol):
8n/a if protocol is sqlite3.PrepareProtocol:
9n/a return "%f;%f" % (self.x, self.y)
10n/a
11n/acon = sqlite3.connect(":memory:")
12n/acur = con.cursor()
13n/a
14n/ap = Point(4.0, -3.2)
15n/acur.execute("select ?", (p,))
16n/aprint(cur.fetchone()[0])