Document `re.Scanner`

未关闭 适合新手
#106,338 4 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
74/100
Issue 类型
文档
描述清晰度
基本清楚
活跃度
活跃
技术栈
python
领域
documentation

调研方向

从链接的 Lib/re/init.py 位置开始,查看 Scanner 附近现有的 re 文档。添加一段关于 re.Scanner 功能的简洁说明,并考虑采用提议的示例 docstring。完成标准是标准库文档能够清楚地解释该功能,并反映其实际用法。

由索引模型根据 Issue 内容生成。

描述

docs topic-regex

Documentation

re.Scanner is currently marked as "experimental" but was added to the standard library 24 years ago[0].
People seem to think this is an interesting feature[1][2] and a github code search for re.Scanner( gives >500 hits[3],
suggesting people have found practical uses for the class.

Proposal

I suggest we add a few lines to the docs describing what it is and perhaps a short docstring with an example.

Some previously collated discussions:
https://github.com/python/cpython/issues/91308#issuecomment-1093947379

[0]. https://github.com/python/cpython/blob/dbefa88b27ee1f124f782363b139aee3f1ccf590/Lib/re/__init__.py#L327
[1]. https://news.ycombinator.com/item?id=36517749
[2]. https://www.reddit.com/r/ProgrammerTIL/comments/4tpt03/python_til_about_rescanner_which_is_useful_for/
[3]. https://github.com/search?q=re.Scanner%28+language%3APython&type=code

主要语言
Python
星标
77.2k
派生
36k
平均合并
1 天 10 小时
30 天内合并 PR
560

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

python/cpython 的其他 Issue

查看 python/cpython 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。