Add more useful help for special name in `help()`
Chưa có ai nhận issue này.
- Ngôn ngữ chính
- Python
- Star
- 77.2k
- Fork
- 35.9k
- Chỉ số merge pull request
- Chỉ số pull request đang chờ
Mô tả
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
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Hướng nghiên cứu
Bắt đầu bằng cách chạy help("name") và so sánh đầu ra hiện tại với các ví dụ được đề xuất cho name và file. Hoàn thành có nghĩa là help() cung cấp các giải thích thân thiện, hữu ích cho các biến đặc biệt được chọn; hãy xem lại PR được liên kết gh-137966 trước khi bắt đầu.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- python
- Lĩnh vực
- documentation
- Loại issue
- Tính năng
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức độ hoạt động
- Đình trệ
- Độ rõ ràng
- Khá rõ ràng
- Mức phù hợp với người mới
- 25/100