From bfa7197b401f33231343c9613bad1cd2a941bfdb Mon Sep 17 00:00:00 2001 From: Skip Montanaro Date: Thu, 30 Jan 2003 12:53:40 +0000 Subject: [PATCH] add some To Do items (to David Goodger - don't shoot me because the text now has embedded URLs - they are temporary. ;-). added [optional keyword args] to the constructor prototypes. --- pep-0305.txt | 29 ++++++++++++++++++++++------- 1 file changed, 22 insertions(+), 7 deletions(-) diff --git a/pep-0305.txt b/pep-0305.txt index 142817d45..e1156b622 100644 --- a/pep-0305.txt +++ b/pep-0305.txt @@ -27,6 +27,19 @@ it possible for programmers to select a CSV module which meets their requirements. +To Do (Notes for the Interested and Ambitious) +============================================== + +- Need to better explain the advantages of a purpose-built csv module + over the simple ",".join() and [].split() approach. + +- Need to complete initial list of formatting parameters and settle on + names. + +- Better motivation for the choice of passing a file object to the + constructors. See http://manatee.mojam.com/pipermail/csv/2003-January/000179.html + + Existing Modules ================ @@ -63,13 +76,14 @@ Module Interface The module supports two basic APIs, one for reading and one for writing. The basic reading interface is:: - reader(fileobj [, dialect='excel2000']) + reader(fileobj [, dialect='excel2000'] [optional keyword args]) A reader object is an iterable which takes a file-like object opened for reading as the sole required parameter. The optional dialect -parameter is discussed below. It also accepts several keyword -parameters which define specific format settings (see the section -"Formatting Parameters"). Readers are typically used as follows:: +parameter is discussed below. It also accepts several optional +keyword arguments which define specific format settings for the parser +(see the section "Formatting Parameters"). Readers are typically used +as follows:: csvreader = csv.reader(file("some.csv")) for row in csvreader: @@ -77,11 +91,12 @@ parameters which define specific format settings (see the section The writing interface is similar:: - writer(fileobj [, dialect='excel2000'], [, fieldnames=list]) + writer(fileobj [, dialect='excel2000'], [, fieldnames=list] + [optional keyword args]) A writer object is a wrapper around a file-like object opened for -writing. It accepts the same keyword parameters as the reader -constructor. In addition, it accepts an optional fieldnames +writing. It accepts the same optional keyword parameters as the +reader constructor. In addition, it accepts an optional fieldnames argument. This is a list which defines the order of fields in the output file. It allows the write() method to accept mapping objects as well as sequence objects.