Mercurial > cpython-lru_cache-weakref
annotate Doc/lib/sqlite3/rowclass.py @ 39940:dfd809dcf680 2.5
Bug #1446043: correctly raise a LookupError if an encoding name given
to encodings.search_function() contains a dot.
(backport from rev. 52075)
| author | Georg Brandl <georg@python.org> |
|---|---|
| date | Sat, 30 Sep 2006 11:22:35 +0000 |
| parents | cf19a123a5d9 |
| children |
| rev | line source |
|---|---|
|
38069
cf19a123a5d9
Further integration of the documentation for the sqlite3 module. There's still
Gerhard Häring <gh@ghaering.de>
parents:
diff
changeset
|
1 import sqlite3 |
|
cf19a123a5d9
Further integration of the documentation for the sqlite3 module. There's still
Gerhard Häring <gh@ghaering.de>
parents:
diff
changeset
|
2 |
|
cf19a123a5d9
Further integration of the documentation for the sqlite3 module. There's still
Gerhard Häring <gh@ghaering.de>
parents:
diff
changeset
|
3 con = sqlite3.connect("mydb") |
|
cf19a123a5d9
Further integration of the documentation for the sqlite3 module. There's still
Gerhard Häring <gh@ghaering.de>
parents:
diff
changeset
|
4 con.row_factory = sqlite3.Row |
|
cf19a123a5d9
Further integration of the documentation for the sqlite3 module. There's still
Gerhard Häring <gh@ghaering.de>
parents:
diff
changeset
|
5 |
|
cf19a123a5d9
Further integration of the documentation for the sqlite3 module. There's still
Gerhard Häring <gh@ghaering.de>
parents:
diff
changeset
|
6 cur = con.cursor() |
|
cf19a123a5d9
Further integration of the documentation for the sqlite3 module. There's still
Gerhard Häring <gh@ghaering.de>
parents:
diff
changeset
|
7 cur.execute("select name_last, age from people") |
|
cf19a123a5d9
Further integration of the documentation for the sqlite3 module. There's still
Gerhard Häring <gh@ghaering.de>
parents:
diff
changeset
|
8 for row in cur: |
|
cf19a123a5d9
Further integration of the documentation for the sqlite3 module. There's still
Gerhard Häring <gh@ghaering.de>
parents:
diff
changeset
|
9 assert row[0] == row["name_last"] |
|
cf19a123a5d9
Further integration of the documentation for the sqlite3 module. There's still
Gerhard Häring <gh@ghaering.de>
parents:
diff
changeset
|
10 assert row["name_last"] == row["nAmE_lAsT"] |
|
cf19a123a5d9
Further integration of the documentation for the sqlite3 module. There's still
Gerhard Häring <gh@ghaering.de>
parents:
diff
changeset
|
11 assert row[1] == row["age"] |
|
cf19a123a5d9
Further integration of the documentation for the sqlite3 module. There's still
Gerhard Häring <gh@ghaering.de>
parents:
diff
changeset
|
12 assert row[1] == row["AgE"] |
