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

Skip to content

Commit b584505

Browse files
committed
small fixes in the examples and in the markup
1 parent 8f7649e commit b584505

1 file changed

Lines changed: 12 additions & 11 deletions

File tree

Doc/library/sqlite3.rst

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -79,12 +79,12 @@ This example uses the iterator form::
7979
>>> c = conn.cursor()
8080
>>> c.execute('select * from stocks order by price')
8181
>>> for row in c:
82-
... print(row)
82+
... print(row)
8383
...
84-
(u'2006-01-05', u'BUY', u'RHAT', 100, 35.14)
85-
(u'2006-03-28', u'BUY', u'IBM', 1000, 45.0)
86-
(u'2006-04-06', u'SELL', u'IBM', 500, 53.0)
87-
(u'2006-04-05', u'BUY', u'MSOFT', 1000, 72.0)
84+
('2006-01-05', 'BUY', 'RHAT', 100, 35.14)
85+
('2006-03-28', 'BUY', 'IBM', 1000, 45.0)
86+
('2006-04-06', 'SELL', 'IBM', 500, 53.0)
87+
('2006-04-05', 'BUY', 'MSOFT', 1000, 72.0)
8888
>>>
8989

9090

@@ -589,18 +589,19 @@ Now we plug :class:`Row` in::
589589
<sqlite3.Cursor object at 0x7f4e7dd8fa80>
590590
>>> r = c.fetchone()
591591
>>> type(r)
592-
<type 'sqlite3.Row'>
593-
>>> r
594-
(u'2006-01-05', u'BUY', u'RHAT', 100.0, 35.14)
592+
<class 'sqlite3.Row'>
593+
>>> tuple(r)
594+
('2006-01-05', 'BUY', 'RHAT', 100.0, 35.14)
595595
>>> len(r)
596596
5
597597
>>> r[2]
598-
u'RHAT'
598+
'RHAT'
599599
>>> r.keys()
600600
['date', 'trans', 'symbol', 'qty', 'price']
601601
>>> r['qty']
602602
100.0
603-
>>> for member in r: print member
603+
>>> for member in r:
604+
... print(member)
604605
...
605606
2006-01-05
606607
BUY
@@ -647,7 +648,7 @@ This is how SQLite types are converted to Python types by default:
647648
+=============+=============================================+
648649
| ``NULL`` | :const:`None` |
649650
+-------------+---------------------------------------------+
650-
| ``INTEGER`` | :class`int` |
651+
| ``INTEGER`` | :class:`int` |
651652
+-------------+---------------------------------------------+
652653
| ``REAL`` | :class:`float` |
653654
+-------------+---------------------------------------------+

0 commit comments

Comments
 (0)