Issue 14880: csv.reader and .writer use wrong kwargs notation in 2.7 docs (original) (raw)

Created on 2012-05-22 07:07 by hynek, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
issue14880.patch cvrebert,2012-08-27 05:50 fix all 3 instances of fmtparam review
Messages (8)
msg161332 - (view) Author: Hynek Schlawack (hynek) * (Python committer) 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) * (Python committer) 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) * (Python committer) 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) * (Python committer) 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) * (Python committer) 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) * (Python committer) 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) (Python triager) 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) * (Python committer) Date: 2012-08-28 10:36
Thank you for your contribution Chris!
History
Date User Action Args
2022-04-11 14:57:30 admin set github: 59085
2012-08-28 10:36:29 hynek set status: open -> closedresolution: fixedmessages: + stage: patch review -> resolved
2012-08-28 10:35:28 python-dev set nosy: + python-devmessages: +
2012-08-28 10:19:58 hynek set messages: +
2012-08-28 09:40:28 petri.lehtinen set messages: +
2012-08-28 06:45:47 hynek set messages: +
2012-08-27 10:02:51 petri.lehtinen set messages: + stage: patch review
2012-08-27 05:50:14 cvrebert set files: + issue14880.patchkeywords: + patch
2012-05-22 21:00:22 cvrebert set nosy: + cvrebert
2012-05-22 07:12:21 petri.lehtinen set nosy: + petri.lehtinenmessages: +
2012-05-22 07:07:35 hynek create