[Python-Dev] weird docstring generated by argument clinic

Guido van Rossum guido at python.org
Thu Jan 30 07:36:44 CET 2014

I suppose it's related to this checkin:

changeset:   88792:d6311829da15
parent:      88788:6b37e6aff9ef
user:        Larry Hastings <larry at hastings.org>
date:        Tue Jan 28 05:00:08 2014 -0800
files:       Include/object.h Lib/idlelib/idle_test/test_calltips.py
Lib/inspect.py Lib/test/test_capi.py Lib/test/test_generators.py
Lib/test/test_genexps.py Misc/NEWS Modules/_bz2module.c Modules/_cryp\
tmodule.c Modules/_cursesmodule.c Modules/_datetimemodule.c
Modules/_dbmmodule.c Modules/_lzmamodule.c Modules/_lzmamodule.clinic.c
Modules/_opcode.c Modules/_pickle.c Modules/_sre.c Modules/_testcapimod\
ule.c Modules/_weakref.c Modules/audioop.c Modules/binascii.c
Modules/clinic/_bz2module.c.h Modules/clinic/_lzmamodule.c.h
Modules/clinic/_pickle.c.h Modules/clinic/audioop.c.h
h Modules/clinic/zlibmodule.c.h Modules/posixmodule.c Modules/unicodedata.c
Modules/zlibmodule.c Objects/descrobject.c Objects/dictobject.c
Objects/methodobject.c Objects/typeobject.c Objects/unicodeobje\
ct.c Python/import.c Tools/clinic/clinic.py
Issue #20326: Argument Clinic now uses a simple, unique signature to
annotate text signatures in docstrings, resulting in fewer false
positives.  "self" parameters are also explicitly marked, allowing
inspect.Signature() to authoritatively detect (and skip) said parameters.

Issue #20326: Argument Clinic now generates separate checksums for the
input and output sections of the block, allowing external tools to verify
that the input has not changed (and thus the output is not out-of-date).

On Wed, Jan 29, 2014 at 10:25 PM, Stefan Behnel <stefan_ml at behnel.de> wrote:

> Hi,
> for two days now, the signature embedding tests in Cython have been failing
> with this (doctest) error:
> """
> Expected:
>     f_D(long double D) -> long double
> Got:
>     f_DNone
>     f_D(long double D) -> long double
> """
> https://sage.math.washington.edu:8091/hudson/job/cython-devel-tests/1869/ARCH=m64,BACKEND=c,PYVERSION=py3km/testReport/junit/doctest/DocTestCase/Doctest__embedsignatures/
> The first line that Cython writes into the docstring is the "expected" one
> above. So far, all CPython versions have ignored it, Py3.4 then started
> picking it up at some point due to the argument clinic changes, but
> properly copied it over to the (IIRC) "__signature__" attribute. However,
> the recent change now lead to the above being dumped into the docstring.
> Could someone please quickly explain what the purpose of the first line is
> and why it says "None" at the end?
> Is there anything we should do on our side in order to fix this? Since many
> of our users embed their signatures for documentation purposes (it was the
> only way to make them visible in previous CPython versions and is supported
> by several tools, e.g. epydoc), this is a rather annoying result for them.
> Stefan
> _______________________________________________
> Python-Dev mailing list
> Python-Dev at python.org
> https://mail.python.org/mailman/listinfo/python-dev
> Unsubscribe:
> https://mail.python.org/mailman/options/python-dev/guido%40python.org

--Guido van Rossum (python.org/~guido)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-dev/attachments/20140129/98883928/attachment.html>

More information about the Python-Dev mailing list