Add more useful help for special name in `help()`
未关闭
还没有人认领这个 Issue。
interpreter-core
type-feature
- 主要语言
- Python
- 星标
- 77.2k
- 派生
- 35.9k
- PR 合并指标
- PR 指标待抓取
描述
Feature or enhancement
Proposal:
Now, use help("__name__") and some other special variables' names will still get the help from their class. I think that we can add the useful help on them. For example:
>>>help("__name__")
1. module.__name__ : if the module is run as the main module, the value is ‘_main_‘, or the name is the filename of the module. For example:if __name__ == "__main__": ...can control which code don’t run when the module is imported.
2. cls.__name__: the name of the class. It must be str.
For other special variables (such as __file__), we can alse print the similar detailed help. And I think that the sentences need to be friendly.
Also welcome to give the ideals on new ideas
Has this already been discussed elsewhere?
No response given
Links to previous discussion of this feature:
No response
Linked PRs
- gh-137966
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
调研方向
首先运行 help("name"),并将其当前输出与针对 name 和 file 提出的示例进行比较。当 help() 为所选特殊变量提供友好且有用的解释时,即表示完成;开始之前请先查看链接的 PR gh-137966。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- python
- 领域
- documentation
- Issue 类型
- 功能
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 活跃度
- 停滞
- 描述清晰度
- 基本清楚
- 新手友好度
- 25/100