Add discussion of doctesting interactive code examples.

未關閉
#1,134 0 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

還沒有人認領這個 Issue。

評估

難度
3/5
預估耗時
1-2 天
新手友好度
35/100
Issue 類型
文件
描述清晰度
基本清楚
活躍度
停滯
技術堆疊
python
領域
documentation

研究方向

閱讀 Documentation/Style Guide/Code Examples 和 doctest 文件,尤其是互動式範例和指示詞指南。檢視 Docs/Doctest CI 檢查以及所參照的討論,以確立目前的政策,然後在現有章節中或緊接其後的新章節中加入簡潔的摘要。完成的標準是指南說明互動式範例預期的 doctest 行為以及相關指示詞。

由索引模型根據 Issue 內容生成。

描述

topic-documentation topic-test type-feature

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.

主要語言
Python
星號
2.1k
分支
1k
平均合併
2 天 12 小時
30 天內合併 PR
12

貢獻指南

開啟貢獻指南

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

python/devguide 的其他 Issue

查看 python/devguide 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。