weird docstring generated by argument clinic

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/ARC... 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

I suppose it's related to this checkin: changeset: 88792:d6311829da15 parent: 88788:6b37e6aff9ef user: Larry Hastings <larry@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 Modules/clinic/binascii.c.\ 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 description: 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@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/ARC...
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@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)

Guido van Rossum, 30.01.2014 07:36:
I suppose it's related to this checkin: [...] Issue #20326: Argument Clinic now uses a simple, unique signature to annotate text signatures in docstrings, resulting in fewer false positives.[...]
Thanks, I'll comment there.
On Wed, Jan 29, 2014 at 10:25 PM, Stefan Behnel wrote:
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 """
And I should have checked a bit more deeply. The None part here is the __text_signature__, which is no longer filled. The commit above explains it. Stefan

On 01/29/2014 10:25 PM, Stefan Behnel 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 """
The string "f_DNone" shouldn't be there. However, "f_DNone" doesn't appear in a fresh checkout of CPython trunk. If you have a reproducable test case, please file it with an issue on the tracker and add me to the nosy list. //arry/

Larry Hastings, 30.01.2014 08:14:
On 01/29/2014 10:25 PM, Stefan Behnel wrote:
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 """
The string "f_DNone" shouldn't be there. However, "f_DNone" doesn't appear in a fresh checkout of CPython trunk. If you have a reproducable test case, please file it with an issue on the tracker and add me to the nosy list.
Sorry, my fault. Please ignore that part. Stefan
participants (3)
-
Guido van Rossum
-
Larry Hastings
-
Stefan Behnel