Add a "warning" option to enum.FlagBoundary
未关闭
@ethanfurman 已经在做这个了。
开始于 2022年12月5日。
stdlib
type-feature
- 主要语言
- Python
- 星标
- 77.2k
- 派生
- 36k
- PR 合并指标
- PR 指标待抓取
描述
Feature or enhancement
The new enum.FlagBoundary system seems quite nice, but there does not appear to be an option to accept a value (a.k.a KEEP) but warn when out of range (STRICT throws an error, and would require a second class to wrap the value).
Pitch
I see two possible options:
- Add a new flag (e.g.
WARNorWARN_KEEP) which warns when the value is out of range - Modify
KEEPsuch that a warning is displayed when the value is out of range
(1) seems like the better option from a backwards-compatibility perspective, but (2) seems like the better option from a usability and maintenance perspective (as missing values are easier to spot).
Previous discussion
None
Linked PRs
- gh-154501
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
评估
这个 Issue 还没有评估数据。