Add discussion of doctesting interactive code examples.
還沒有人認領這個 Issue。
- 主要語言
- Python
- 星號
- 2.1k
- 分支
- 1k
- 平均合併
- 2 天 12 小時
- 30 天內合併 PR
- 12
描述
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.
貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
研究方向
閱讀 Documentation/Style Guide/Code Examples 和 doctest 文件,尤其是互動式範例和指示詞指南。檢視 Docs/Doctest CI 檢查以及所參照的討論,以確立目前的政策,然後在現有章節中或緊接其後的新章節中加入簡潔的摘要。完成的標準是指南說明互動式範例預期的 doctest 行為以及相關指示詞。
由索引模型根據 Issue 內容生成。
評估
- 技術堆疊
- python
- 領域
- documentation
- Issue 類型
- 文件
- 難度
- 3/5
- 預估耗時
- 1-2 天
- 活躍度
- 停滯
- 描述清晰度
- 基本清楚
- 新手友好度
- 35/100