python / python/cpython

Py_DEPRECATED should account for Py_Limited_API

Đang mở
#117,927 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

type-feature
Ngôn ngữ chính
Python
Star
77.2k
Fork
36k
Chỉ số merge pull request
Chỉ số pull request đang chờ

Mô tả

Feature or enhancement

Proposal:

Take the example of Py_SetPythonHome().
It has been deprecated in 3.11, and we should now do things with PyConfig (added in 3.8).
But it is also part of the limited API. So it should not actually disappear, and someone building with Py_Limited_API<3.8 does not have the available symbols to use the non deprecated variant.
So every developer building with the limited API that cares about the warning will have to study each deprecated function, and if the non deprecated vairant is not in the stable API, add local deprecation warning disable code.

The proposal:
When Py_LimitedAPI is defined, Py_Deprecated should not trigger a warning if The deprecation version is greater than the limited API version selected by the macro (3.2 if the macro is empty, otherwise, the version value in Py_Limited_API), since we are really compiling for a lower version of python

I can probably do the PR myself if it is accepted

Has this already been discussed elsewhere?

This is a minor feature, which does not need previous discussion elsewhere

Links to previous discussion of this feature:

No response

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. 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.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. 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 xác định các định nghĩa và cách sử dụng của Py_DEPRECATED và Py_Limited_API trong các header của CPython, sau đó theo dõi khai báo Py_SetPythonHome như một ví dụ cụ thể. Kiểm tra cách phiên bản limited-API được chọn ảnh hưởng đến các cảnh báo không còn được khuyến nghị sử dụng, và xác minh rằng các cảnh báo chỉ bị tắt khi phần thay thế không khả dụng trong phiên bản API đó.

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
api
Loại issue
Tính năng
Độ khó
4/5
Thời gian dự kiến
3-5 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
38/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.