view Doc/includes/sqlite3/rowclass.py @ 57114:d3a81051663b

importlib.test.source.util referenced variables in the 'finally' part of a try/finally which may not have been set.
author Brett Cannon <bcannon@gmail.com>
date Thu, 05 Nov 2009 01:17:22 +0000
parents 9e1529bf0442
children 9eb77d455be1
line wrap: on
line source

import sqlite3

con = sqlite3.connect("mydb")
con.row_factory = sqlite3.Row

cur = con.cursor()
cur.execute("select name_last, age from people")
for row in cur:
    assert row[0] == row["name_last"]
    assert row["name_last"] == row["nAmE_lAsT"]
    assert row[1] == row["age"]
    assert row[1] == row["AgE"]