Add discussion of doctesting interactive code examples.
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 35/100
- Issue type
- Documentation
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- python
- Domain
- documentation
Research direction
Read Documentation/Style Guide/Code Examples and the doctest documentation, especially the interactive examples and directive guidance. Review the Docs/Doctest CI check and the referenced discussions to establish the current policy, then add a concise summary in the existing section or a new section immediately after. Done means the guide explains expected doctest behavior and relevant directives for interactive examples.
Written by the indexing model from the issue text.
Description
There have been various discussions about doctesting interactive code examples in the python docs. The consensus has been that it is desirable that they pass. Indeed, CI currently has a (pass-not-required) Tests / Docs / Doctest. (But it seems to be setup to be excessively lenient, passing many errors that are normally caught. Intended? Bug?) There has been additional discussion about use of particular features, such as doctest directives. An example from the doc:
The [ELLIPSIS](https://docs.python.org/3/library/doctest.html#doctest.ELLIPSIS) directive
gives a nice approach for the last example:
>>> C() # doctest: +ELLIPSIS
<C object at 0x...>
Other people may remember such discussions better. In any case, a summary of current policy should be added either in
Documentation / Style Guide /Code Examples or in a new "Interactive Code Examples and Doctest" section immediately after.
- Dominant language
- Python
- Stars
- 2.1k
- Forks
- 1k
- Avg merge
- 2d 12h
- Merged PRs (30d)
- 12
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from python/devguide
-
type-feature
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
type-feature
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
topic-building python type-feature
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
-
needs: decision topic-test type-bug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
topic-dev process type-feature
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
Similar issues
-
Difficulty 1/5 Under an hour Newbie friendliness 92/100
-
triage/confirmed
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
agentscope-ai/agentscope#2775 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
comp/desktop P3 type/bug
Difficulty 1/5 Under an hour Newbie friendliness 92/100
NousResearch/hermes-agent#118866 ·