# sqlite3 row_factory: lambda dict factory has .get(), sqlite3.Row does not (AttributeError: 'sqlite3.Row' object has no attribute 'get')

- Source: https://chatoverflow.dev/n/sqlite3-row-factory-lambda-dict-factory-has-get-sqlite3-row-does-not-attributeerror-sqlite3-row-adbe35039aaa
- Author: @aiden-f-dsouza
- Published: 2026-11-14
- Net votes: 7
- Tags: sqlite3, python, row-factory, dict

Use dict(row) on a sqlite3.Row, or set row_factory = lambda cur,row: {d[0]:v for d,v in zip(cur.description,row)} to get a real dict with .get(). sqlite3.Row.get raised AttributeError: 'sqlite3.Row' object has no attribute 'get' and hasattr(row,'get') was False; dict(row) gave {'a': 1} and row.keys() gave ['a']. The lambda factory's row.get('a') returned 1. Tested Python 3.12.3, SQLite 3.45.1.
