msg161332 - (view) |
Author: Hynek Schlawack (hynek) *  |
Date: 2012-05-22 07:07 |
It says > csv.reader(csvfile[, dialect='excel'][, fmtparam]) > csv.writer(csvfile[, dialect='excel'][, fmtparam]) in 2.7. I presume it should be like in 3.x: > csv.reader(csvfile, dialect='excel', **fmtparams) > csv.writer(csvfile, dialect='excel', **fmtparams) Or am I missing something? (I found argument renaming to be too invasive for my default-args-notation ticket #14804) |
|
|
msg161333 - (view) |
Author: Petri Lehtinen (petri.lehtinen) *  |
Date: 2012-05-22 07:12 |
I verified from the source that it should be **fmtparams also in 2.7. Make sure you change the description texts, too, to s/fmtparam/fmtparams/. |
|
|
msg169192 - (view) |
Author: Petri Lehtinen (petri.lehtinen) *  |
Date: 2012-08-27 10:02 |
Chris: Thanks for the patch. I'm not sure register_dialect()'s signature is good like that, though. Hynek, what do you think? |
|
|
msg169254 - (view) |
Author: Hynek Schlawack (hynek) *  |
Date: 2012-08-28 06:45 |
What does bother you? Both sigs look like in py3 if I'm looking correctly. |
|
|
msg169261 - (view) |
Author: Petri Lehtinen (petri.lehtinen) *  |
Date: 2012-08-28 09:40 |
Well, I wasn't sure about [optional] params before **kwargs. But if that's ok, then I think the patch is good. |
|
|
msg169265 - (view) |
Author: Hynek Schlawack (hynek) *  |
Date: 2012-08-28 10:19 |
It seems correct like that: static PyObject * csv_register_dialect(PyObject *module, PyObject *args, PyObject *kwargs) { PyObject *name_obj, *dialect_obj = NULL; PyObject *dialect; if (!PyArg_UnpackTuple(args, "", 1, 2, &name_obj, &dialect_obj)) return NULL; Therefore going to commit. |
|
|
msg169267 - (view) |
Author: Roundup Robot (python-dev)  |
Date: 2012-08-28 10:35 |
New changeset dc080e19f7aa by Hynek Schlawack in branch '2.7': #14880: Fix kwargs notation in csv.reader, .writer & .register_dialect http://hg.python.org/cpython/rev/dc080e19f7aa |
|
|
msg169268 - (view) |
Author: Hynek Schlawack (hynek) *  |
Date: 2012-08-28 10:36 |
Thank you for your contribution Chris! |
|
|