[issue1227] csv docs say 'excel_tab'; code says 'excel-tab'

2007-10-01 Thread Dean Elzinga

New submission from Dean Elzinga:

I was trying out 'csv module' and noticed that it wouldn't accept a
dialect of 'excel_tab' as documented.

Then I noticed that csv.list_dialects() gave 'excel-tab' instead of
'excel_tab' as documented.

I'm not sure which one it's supposed to be, but I guess when in doubt
the docs are wrong. I leave these issues to the higher gods.

Thanks for the work on this module. I'm enjoying it!

--
components: Library (Lib)
messages: 56211
nosy: dcelzinga
severity: normal
status: open
title: csv docs say 'excel_tab'; code says 'excel-tab'
type: behavior
versions: Python 2.5

__
Tracker <[EMAIL PROTECTED]>
<http://bugs.python.org/issue1227>
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1227] csv docs say 'excel_tab'; code says 'excel-tab'

2007-10-02 Thread Dean Elzinga

Dean Elzinga added the comment:

Ohh! Thanks for the clarification. Sorry for the misunderstanding.

> -Original Message-
> From: Skip Montanaro [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, October 02, 2007 8:14 AM
> To: [EMAIL PROTECTED]
> Subject: [issue1227] csv docs say 'excel_tab'; code says
> 'excel-tab'
> 
> 
> Skip Montanaro added the comment:
> 
> The string name of the dialect is "excel-tab".  Hyphens
> are not
> valid characters in identifiers though, so the actual
> object
> is named "excel_tab".  When you call
> csv.get_dialect("excel-tab")
> it instantiates the csv.excel_tab class and returns that:
> 
> >>> csv.list_dialects()
> ['excel-tab', 'excel']
> >>> csv.get_dialect("excel-tab")
> 
> >>> csv.excel_tab
> 
> >>> csv.get_dialect("excel-tab").__class__ ==
> csv.excel_tab
> True
> 
> --
> assignee:  -> skip.montanaro
> nosy: +skip.montanaro
> resolution:  -> works for me
> status: open -> closed
> 
> __
> Tracker <[EMAIL PROTECTED]>
> <http://bugs.python.org/issue1227>
> __

__
Tracker <[EMAIL PROTECTED]>
<http://bugs.python.org/issue1227>
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com