[New-bugs-announce] [issue35889] sqlite3.Row doesn't have useful repr

Vlad Shcherbina report at bugs.python.org
Sat Feb 2 08:02:16 EST 2019


New submission from Vlad Shcherbina <vlad.shcherbina at gmail.com>:

To reproduce, run the following program:

import sqlite3
conn = sqlite3.connect(':memory:')
conn.row_factory = sqlite3.Row
print(conn.execute("SELECT 'John' AS name, 42 AS salary").fetchone())

It prints '<sqlite3.Row object at 0xffffffffffffff>'.
It would be nice if it printed something like "sqlite3.Row(name='Smith', saraly=42)" instead.
It wouldn't satisfy the 'eval(repr(x)) == x' property, but it's still better than nothing.

If the maintainers agree this is useful, I'll implement.

----------
components: Library (Lib)
messages: 334746
nosy: vlad
priority: normal
severity: normal
status: open
title: sqlite3.Row doesn't have useful repr
type: enhancement
versions: Python 2.7, Python 3.4, Python 3.5, Python 3.6, Python 3.7, Python 3.8

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue35889>
_______________________________________


More information about the New-bugs-announce mailing list