Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(127321)

#3158: Doctest fails to find doctests in extension modules

Can't Edit
Can't Publish+Mail
Start Review
Created:
6 years, 4 months ago by fer_perez
Modified:
5 years, 9 months ago
Reviewers:
rdmurray, zachary.ware
CC:
tim.peters, fer_perez_users.sourceforge.net, amaury.forgeotdarc, larry, shamrin_gmail.com, r.david.murray, devnull_psf.upfronthosting.co.za, eric.snow, Thomas Kluyver, jtaylor, Zach Ware
Visibility:
Public.

Patch Set 1 #

Total comments: 8

Patch Set 2 #

Patch Set 3 #

Unified diffs Side-by-side diffs Delta from patch set Stats Patch
Lib/doctest.py View 1 2 1 chunk +7 lines, -1 line 0 comments Download

Messages

Total messages: 2
r.david.murray
http://bugs.python.org/review/3158/diff/8673/Doc/library/doctest.rst File Doc/library/doctest.rst (right): http://bugs.python.org/review/3158/diff/8673/Doc/library/doctest.rst#newcode282 Doc/library/doctest.rst:282: Extension modules are now fully searched as well. Should ...
6 years ago #1
Zach Ware
6 years ago #2
http://bugs.python.org/review/3158/diff/8673/Doc/library/doctest.rst
File Doc/library/doctest.rst (right):

http://bugs.python.org/review/3158/diff/8673/Doc/library/doctest.rst#newcode282
Doc/library/doctest.rst:282: Extension modules are now fully searched as well.
On 2013/11/08 03:56:57, r.david.murray wrote:
> Should this say "CPython extension modules"?  That is, is it a CPython
specific
> change, or will the changes to the inspect logic mean extension modules in
other
> implementations will now be be checked where they weren't before?

It probably should specify "CPython extension modules".  Depending on how other
implementations implement extension modules, this patch should either make
extension module doctests work or make no difference at all; I'm not sure which.

http://bugs.python.org/review/3158/diff/8673/Doc/library/doctest.rst#newcode1293
Doc/library/doctest.rst:1293: (built-in methods), staticmethods, classmethods,
and properties.
On 2013/11/08 03:56:57, r.david.murray wrote:
> Are 'method descriptor' and "build-in method' really synonyms?  I didn't think
> they were, but I guess I don't have a very deep understanding of the
descriptor
> protocol.

I don't either, but the two terms seem to be synonymous from what it took to get
this patch working.

Perhaps this section should just be left alone, and not point out "built-in"?

http://bugs.python.org/review/3158/diff/8673/Doc/library/doctest.rst#newcode1349
Doc/library/doctest.rst:1349: built-in functions and methods.
On 2013/11/08 03:56:57, r.david.murray wrote:
> Again, is this CPython-specific?  It sounds less so, since 'built-in' could
> apply to other implementations.

It's about as CPython-specific as the first change above.

Perhaps this note shouldn't be added either, and the first change above should
be converted into a "CPython implementation detail: modules written in C were
not completely searched for doctests until version 3.4" note?  That should leave
the file pretty much completely agnostic of module implementation.

http://bugs.python.org/review/3158/diff/8673/Lib/test/test_doctest.py
File Lib/test/test_doctest.py (right):

http://bugs.python.org/review/3158/diff/8673/Lib/test/test_doctest.py#newcode648
Lib/test/test_doctest.py:648: Finding Doctests in Extension Modules
On 2013/11/08 03:56:57, r.david.murray wrote:
> What about a test for method descriptors?

Those are covered by this test: float.as_integer_ratio, float.hex, and
int.bit_length are all <class 'method_descriptor'>s. float.fromhex (classmethod)
and the added doctests on bin, hex, and oct cover <class
'builtin_function_or_method'>.

With my proposed changes to patch to the doctest docs, though, the prose here
could stand to be changed as well to be more vague about "extension module" or
C.
Sign in to reply to this message.

RSS Feeds Recent Issues | This issue
This is Rietveld 894c83f36cb7+