[Python-checkins] python/nondist/peps pep-0305.txt,1.9,1.10

davecole@users.sourceforge.net davecole@users.sourceforge.net
Sun, 02 Feb 2003 04:25:26 -0800


Update of /cvsroot/python/python/nondist/peps
In directory sc8-pr-cvs1:/tmp/cvs-serv18578

Modified Files:
	pep-0305.txt 
Log Message:
Changed the csv.reader() fileobj argument to interable.  This give us
much more flexibility in processing filtered data.
Made the example excel dialect match the dialect in csv.py.
Added explanation of doublequote.
Added explanation of csv.QUOTE_NONE.


Index: pep-0305.txt
===================================================================
RCS file: /cvsroot/python/python/nondist/peps/pep-0305.txt,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** pep-0305.txt	31 Jan 2003 21:55:38 -0000	1.9
--- pep-0305.txt	2 Feb 2003 12:25:23 -0000	1.10
***************
*** 90,98 ****
  writing.  The basic reading interface is::
  
!     obj = 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 optional
  keyword arguments which define specific format settings for the parser
--- 90,98 ----
  writing.  The basic reading interface is::
  
!     obj = reader(iterable [, dialect='excel2000']
                   [optional keyword args])
  
! A reader object is an iterable which takes an interable object which
! returns lines as the sole required parameter.  The optional dialect
  parameter is discussed below.  It also accepts several optional
  keyword arguments which define specific format settings for the parser
***************
*** 154,160 ****
  
      class excel:
-         quotechar = '"'
          delimiter = ','
          escapechar = None
          skipinitialspace = False
          lineterminator = '\r\n'
--- 154,161 ----
  
      class excel:
          delimiter = ','
+         quotechar = '"'
          escapechar = None
+         doublequote = True
          skipinitialspace = False
          lineterminator = '\r\n'
***************
*** 189,198 ****
  
  - ``quotechar`` specifies a one-character string to use as the quoting
!   character.  It defaults to '"'.
  
  - ``delimiter`` specifies a one-character string to use as the field
    separator.  It defaults to ','.
  
! - ``escapechar`` specifies a one character string used to escape the
    delimiter when quotechar is set to None.
  
--- 190,200 ----
  
  - ``quotechar`` specifies a one-character string to use as the quoting
!   character.  It defaults to '"'.  Setting this to None has the same
!   effect as setting quoting to csv.QUOTE_NONE.
  
  - ``delimiter`` specifies a one-character string to use as the field
    separator.  It defaults to ','.
  
! - ``escapechar`` specifies a one-character string used to escape the
    delimiter when quotechar is set to None.
  
***************
*** 216,220 ****
      fields which contain characters other than [+-0-9.].
  
! - ``doublequote`` (tbd)
  
  - are there more to come?
--- 218,227 ----
      fields which contain characters other than [+-0-9.].
  
!     csv.QUOTE_NONE means that quotes are never placed around
!     fields.
! 
! - ``doublequote`` controls the handling of quotes inside fields.  When
!   True two consecutive quotes are interpreted as one during read, and
!   when writing, each quote is written as two quotes.
  
  - are there more to come?