diff options
author | Andrew M. Kuchling <amk@amk.ca> | 2007-03-21 16:57:32 +0000 |
---|---|---|
committer | Andrew M. Kuchling <amk@amk.ca> | 2007-03-21 16:57:32 +0000 |
commit | 7af1bdf619c28e949b8d9a534f481fb591f19b7c (patch) | |
tree | ef4f1d0bbf18afc1c39a9fbc4ccfe343ec35c4f3 | |
parent | 8aa30927ab3227dc9cab17f5430a14b82054b4dd (diff) | |
download | cpython-git-7af1bdf619c28e949b8d9a534f481fb591f19b7c.tar.gz |
Fix sentence, and fix typo in example
-rw-r--r-- | Doc/lib/libcollections.tex | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/Doc/lib/libcollections.tex b/Doc/lib/libcollections.tex index bdc14b5a29..b73805ab9f 100644 --- a/Doc/lib/libcollections.tex +++ b/Doc/lib/libcollections.tex @@ -377,12 +377,13 @@ Setting the \member{default_factory} to \class{set} makes the The use cases are the same as those for tuples. The named factories assign meaning to each tuple position and allow for more readable, - self-documenting code. Can also be used to assign field names to tuples + self-documenting code. Named tuples can also be used to assign field names + to tuples returned by the \module{csv} or \module{sqlite3} modules. For example: \begin{verbatim} import csv - EmployeeRecord = NamedTuple('EmployeeRecord', 'name age title deparment paygrade') + EmployeeRecord = NamedTuple('EmployeeRecord', 'name age title department paygrade') for tup in csv.reader(open("employees.csv", "rb")): print EmployeeRecord(*tup) \end{verbatim} |