From: Radon Rosborough <radon.neon@gmail.com>
To: 29003@debbugs.gnu.org
Subject: bug#29003: 25.3; Docstring from PEP 257 is filled incorrectly by Emacs
Date: Wed, 25 Oct 2017 19:08:47 -0700 [thread overview]
Message-ID: <CADB4rJGsp0dnK59ngewtvMndzRm2eNBB==auC4niccztBQ2_cA@mail.gmail.com> (raw)
I recently noticed that Emacs fills an example docstring given [1] in
PEP 257 incorrectly. With `python-fill-docstring-style' at its default
value of `pep-257', the following code sample:
def complex(real=0.0, imag=0.0):
"""Form a complex number.
Keyword arguments:
real -- the real part (default 0.0)
imag -- the imaginary part (default 0.0)
"""
if imag == 0.0 and real == 0.0:
return complex_zero
...
is filled to:
def complex(real=0.0, imag=0.0):
"""Form a complex number.
Keyword arguments: real -- the real part (default 0.0) imag -- the
imaginary part (default 0.0)
"""
if imag == 0.0 and real == 0.0:
return complex_zero
...
There are two issues here: the extra newline added, and the unwrapping
of the keyword arguments. The extra newline can be suppressed by
changing the value of `python-fill-docstring-style', but the keyword
argument unwrapping does not appear to be suppressible. This seems
erroneous to me since the value of `python-fill-docstring' would suggest
PEP 257 compliance, i.e. the examples given in PEP 257 should not be a
affected by wrapping. (I also checked out the third-party package
`python-docstring' [2], and it has the same behavior.)
next reply other threads:[~2017-10-26 2:08 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-10-26 2:08 Radon Rosborough [this message]
2017-10-26 19:03 ` bug#29003: 25.3; Docstring from PEP 257 is filled incorrectly by Emacs Charles A. Roelli
2017-10-26 19:23 ` Radon Rosborough
2017-10-26 19:41 ` Charles A. Roelli
2019-11-11 2:43 ` Stefan Kangas
2021-11-30 14:56 ` bug#29003: [python.el] " Lars Ingebrigtsen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CADB4rJGsp0dnK59ngewtvMndzRm2eNBB==auC4niccztBQ2_cA@mail.gmail.com' \
--to=radon.neon@gmail.com \
--cc=29003@debbugs.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).