`csv.get_dialect()` returns a `_csv.Dialect` object, not `csv.Dialect` as documented.
未關閉
還沒有人認領這個 Issue。
docs
- 主要語言
- Python
- 星號
- 77.2k
- 分支
- 35.9k
- PR 合併指標
- PR 指標待擷取
描述
The documentation at https://docs.python.org/3/library/csv.html#csv.Dialect indicates that this class is what is returned when calling csv.get_dialect(). But the C implemented class _csv.Dialect() is returned instead.
>>> import csv
>>> csv.get_dialect("excel")
<_csv.Dialect object at 0x0000026C0004DBC0>
This makes writing typesafe code that uses Dialect a challenge. See related typeshed issue at https://github.com/python/typeshed/issues/14667
It's not clear whether this is a documentation or implementation issue.
貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
研究方向
從 csv.get_dialect() 入口點和 issue 中連結的 csv.Dialect 文件開始,接著比較文件所述的回傳型別與執行時產生的 _csv.Dialect 類別。查看相關的 typeshed issue,以了解型別標註的背景。完成的標準是決定應修改文件還是實作,並相應地使公開行為與型別保持一致。
由索引模型根據 Issue 內容生成。
評估
- 技術堆疊
- python
- 領域
- backend
- Issue 類型
- 缺陷
- 難度
- 3/5
- 預估耗時
- 1-2 天
- 活躍度
- 停滯
- 描述清晰度
- 基本清楚
- 新手友好度
- 42/100