Python code coverage for Doc/includes/sqlite3/adapter_point_1.py
# | count | content |
---|---|---|
1 | n/a | import sqlite3 |
2 | n/a | |
3 | n/a | class Point: |
4 | n/a | def __init__(self, x, y): |
5 | n/a | self.x, self.y = x, y |
6 | n/a | |
7 | n/a | def __conform__(self, protocol): |
8 | n/a | if protocol is sqlite3.PrepareProtocol: |
9 | n/a | return "%f;%f" % (self.x, self.y) |
10 | n/a | |
11 | n/a | con = sqlite3.connect(":memory:") |
12 | n/a | cur = con.cursor() |
13 | n/a | |
14 | n/a | p = Point(4.0, -3.2) |
15 | n/a | cur.execute("select ?", (p,)) |
16 | n/a | print(cur.fetchone()[0]) |