Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 946eb86

Browse files
committed
reST indentation fix in sqlite3 docs. rst uses 3 space indentation.
1 parent 187c111 commit 946eb86

1 file changed

Lines changed: 38 additions & 37 deletions

File tree

Doc/library/sqlite3.rst

Lines changed: 38 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -599,43 +599,43 @@ Row Objects
599599

600600
Let's assume we initialize a table as in the example given above::
601601

602-
conn = sqlite3.connect(":memory:")
603-
c = conn.cursor()
604-
c.execute('''create table stocks
605-
(date text, trans text, symbol text,
606-
qty real, price real)''')
607-
c.execute("""insert into stocks
608-
values ('2006-01-05','BUY','RHAT',100,35.14)""")
609-
conn.commit()
610-
c.close()
602+
conn = sqlite3.connect(":memory:")
603+
c = conn.cursor()
604+
c.execute('''create table stocks
605+
(date text, trans text, symbol text,
606+
qty real, price real)''')
607+
c.execute("""insert into stocks
608+
values ('2006-01-05','BUY','RHAT',100,35.14)""")
609+
conn.commit()
610+
c.close()
611611

612612
Now we plug :class:`Row` in::
613613

614-
>>> conn.row_factory = sqlite3.Row
615-
>>> c = conn.cursor()
616-
>>> c.execute('select * from stocks')
617-
<sqlite3.Cursor object at 0x7f4e7dd8fa80>
618-
>>> r = c.fetchone()
619-
>>> type(r)
620-
<class 'sqlite3.Row'>
621-
>>> tuple(r)
622-
('2006-01-05', 'BUY', 'RHAT', 100.0, 35.14)
623-
>>> len(r)
624-
5
625-
>>> r[2]
626-
'RHAT'
627-
>>> r.keys()
628-
['date', 'trans', 'symbol', 'qty', 'price']
629-
>>> r['qty']
630-
100.0
631-
>>> for member in r:
632-
... print(member)
633-
...
634-
2006-01-05
635-
BUY
636-
RHAT
637-
100.0
638-
35.14
614+
>>> conn.row_factory = sqlite3.Row
615+
>>> c = conn.cursor()
616+
>>> c.execute('select * from stocks')
617+
<sqlite3.Cursor object at 0x7f4e7dd8fa80>
618+
>>> r = c.fetchone()
619+
>>> type(r)
620+
<class 'sqlite3.Row'>
621+
>>> tuple(r)
622+
('2006-01-05', 'BUY', 'RHAT', 100.0, 35.14)
623+
>>> len(r)
624+
5
625+
>>> r[2]
626+
'RHAT'
627+
>>> r.keys()
628+
['date', 'trans', 'symbol', 'qty', 'price']
629+
>>> r['qty']
630+
100.0
631+
>>> for member in r:
632+
... print(member)
633+
...
634+
2006-01-05
635+
BUY
636+
RHAT
637+
100.0
638+
35.14
639639

640640

641641
.. _sqlite3-types:
@@ -886,6 +886,7 @@ only makes sense to call from a different thread.
886886
.. rubric:: Footnotes
887887

888888
.. [#f1] The sqlite3 module is not built with loadable extension support by
889-
default, because some platforms (notably Mac OS X) have SQLite libraries which
890-
are compiled without this feature. To get loadable extension support, you must
891-
pass --enable-loadable-sqlite-extensions to configure.
889+
default, because some platforms (notably Mac OS X) have SQLite
890+
libraries which are compiled without this feature. To get loadable
891+
extension support, you must pass --enable-loadable-sqlite-extensions to
892+
configure.

0 commit comments

Comments
 (0)