diff --git a/Doc/library/sqlite3.rst b/Doc/library/sqlite3.rst index 1da5c7f3ab..df5e1339b7 100644 --- a/Doc/library/sqlite3.rst +++ b/Doc/library/sqlite3.rst @@ -802,6 +802,15 @@ Now we plug :class:`Row` in:: 100.0 35.14 +Customising :class:`Row` by adding a pretty-print :func:`repr`:: + + >>> pp_repr = lambda r: f"" + >>> sqlite3.Row.__repr__ = pp_repr + >>> for row in con.execute('select 1 as number, "two" as string, x"1f" as blob'): + ... print(repr(row)) + ... + + .. _sqlite3-exceptions: