Pass variable as final
还没有人认领这个 Issue。
评估
- 难度
- 5/5
- 预计耗时
- 一周以上
- 新手友好度
- 25/100
- Issue 类型
- 功能
- 描述清晰度
- 需要澄清
- 活跃度
- 停滞
- 技术栈
- python
调研方向
首先阅读链接的 CPython issue #113654,并检查当前在 Python typing 中如何使用 Final。在确定实现范围之前,该提案需要一份已经确定的参数注解规范,以及 typing 生态系统中一项达成共识的变更;只有在设计方案被接受并完成相应的 repository 更新后,才算完成。
由索引模型根据 Issue 内容生成。
描述
Proposal:
The idea is to be able to pass variables as constants, mimicking c++ or rust behaviour such as. And have this be solely as part of the typings ecosystem. It's extremely helpful when reviewing code, or starting to use new codebases.
Issue opened in cpython repo: #113654
fn my_function(mut changeable: &String, unchangeable: &String) {}
In python I suggest the following:
def my_function(changeable: str, unchangeable: Final[str])-> None:
arguments_that_changes += "world!"
return arguments_that_changes + argument_that_stays_constant
- 主要语言
- Python
- 星标
- 1.8k
- 派生
- 302
- 平均合并
- 23 小时
- 30 天内合并 PR
- 8
贡献指南
这个仓库没有索引到贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
python/typing 的其他 Issue
-
topic: typing spec
难度 2/5 1-3 小时 新手友好度 72/100
-
topic: typing spec
难度 2/5 1-3 小时 新手友好度 75/100
-
topic: documentation
难度 2/5 1-3 小时 新手友好度 76/100
-
topic: documentation
难度 2/5 1-3 小时 新手友好度 65/100
-
topic: conformance tests topic: typing spec
难度 3/5 1-2 天 新手友好度 72/100
相似的 Issue
-
enhancement
难度 2/5 1-3 小时 新手友好度 70/100
canonical/paas-charm#368 · 1 条评论 ·
-
难度 2/5 1-3 小时 新手友好度 75/100
-
tech debt
难度 2/5 1-3 小时 新手友好度 75/100
-
难度 1/5 1 小时以内 新手友好度 90/100
StevenBlack/hosts#3256 ·
-
难度 1/5 1 小时以内 新手友好度 90/100
qualcomm/qai-appbuilder#275 ·