This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: *args and **kwargs in function definitions
Type: Stage:
Components: Documentation Versions: Python 2.6
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: georg.brandl Nosy List: georg.brandl, lars.gustaebel
Priority: low Keywords:

Created on 2007-08-29 20:34 by lars.gustaebel, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Messages (4)
msg55434 - (view) Author: Lars Gustäbel (lars.gustaebel) * (Python committer) Date: 2007-08-29 20:34
For example in tarfile.rst and logging.rst there are function
definitions using *args and/or **kwargs like:

.. function:: debug(msg[, *args[, **kwargs]])

The * and ** should be escaped IMO, so that they are not mistaken as
reStructuredText markup, which confuses the syntax coloring of my Vim.
While escaping * with a backslash works fine in normal text, it does not
work in a function definition and the backslash appears in the HTML output.
msg55465 - (view) Author: Georg Brandl (georg.brandl) * (Python committer) Date: 2007-08-30 08:05
Lars Gustäbel schrieb:

> For example in tarfile.rst and logging.rst there are function
> definitions using *args and/or **kwargs like:
> 
> .. function:: debug(msg[, *args[, **kwargs]])
> 
> The * and ** should be escaped IMO, so that they are not mistaken as
> reStructuredText markup, which confuses the syntax coloring of my Vim.
> While escaping * with a backslash works fine in normal text, it does not
> work in a function definition and the backslash appears in the HTML output.

This was done deliberately since for C function descriptions

.. cfunction:: PyObject *Py_DoSomething(PyObject *obj1, ...)

it's a PITA to escape all the stars.

The reST highlighting of Vim seems to be insufficient not only in this
regard (inline markup can't span paragraphs); may I convince you to
use a real editor like Emacs? :)

*ducks* Fine, fine, I'll see if I can add backslash processing there.
But I won't add backslashes for all of the existing definitions.
msg55466 - (view) Author: Lars Gustäbel (lars.gustaebel) * (Python committer) Date: 2007-08-30 08:31
Oh, I thought Emacs was an operating system, I didn't know you could
edit text files with it. You live and learn ;-)

I suspected that this was intentional. If you make backslash escaping
optional, that's fine with me.
msg55467 - (view) Author: Georg Brandl (georg.brandl) * (Python committer) Date: 2007-08-30 08:36
Lars Gustäbel schrieb:
> Lars Gustäbel added the comment:
> 
> Oh, I thought Emacs was an operating system, I didn't know you could
> edit text files with it. You live and learn ;-)
> 
> I suspected that this was intentional. If you make backslash escaping
> optional, that's fine with me.

Okay, fixed in rev. 57712.
History
Date User Action Args
2022-04-11 14:56:26adminsetgithub: 45400
2007-08-30 08:36:28georg.brandlsetstatus: open -> closed
resolution: fixed
messages: + msg55467
2007-08-30 08:31:49lars.gustaebelsetmessages: + msg55466
2007-08-30 08:05:16georg.brandlsetnosy: + georg.brandl
messages: + msg55465
2007-08-29 20:34:22lars.gustaebelcreate