Need for a few corrections/updates regarding the `inspect.ismethoddescriptor()`'s and `inspect.isdatadescriptor()`'s docs and unit tests
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ả
Documentation
-
The main correction that needs to be made regards this fragment of the docs of inspect.ismethoddescriptor():
Return
Trueif the object is a method descriptor, but not if ismethod(), isclass(), isfunction() or isbuiltin() are true.The problem is that, in fact, the
inspect.ismethoddescriptor()function does not engage theinspect.isbuiltin()function at all (whereas it does engage the rest of the said functions).(As it seems, the mistaken statement was introduced long ago...)
-
Another thing worth fixing is the lack of the information that the inspect.isdatadescriptor() function also returns False if any of the ismethod(), isclass() or isfunction() tests are true.
-
There are also a few other fragments of the docs of those two functions (
inspect.ismethoddescriptor()andinspect.isdatadescriptor()) which seem to me worth updating/rewording... -
Naturally, it also seems a good idea to update the docstrings of those two functions (where applicable).
All those improvements have been proposed by submitting the first PR attached to this issue [update: merged].
Tests
By the way, it seems worth to make the unit tests for those two functions be more comprehensive as well as consistent with each other.
The tests-related improvements have been proposed by submitting the second PR attached to this issue.
Linked PRs
- gh-122104
- gh-122144
- gh-153948
- gh-153949
- gh-153950
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 với tài liệu và docstring cho inspect.ismethoddescriptor() và inspect.isdatadescriptor(), sau đó xem lại các unit test hiện có cho cả hai hàm. Các PR được liên kết mô tả hoặc chứa các bản cập nhật tài liệu và kiểm thử được đề xuất; công việc hoàn tất khi các sửa đổi đó cùng với phạm vi bao phủ nhất quán hơn được merge.
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, testing
- Loại issue
- Tài liệu
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức độ hoạt động
- Đình trệ
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức phù hợp với người mới
- 20/100