SubTracker: Convert static types (PyTypeObject) to heap types via `PyType_FromModuleAndSpec`

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

Maintainer thường phản hồi trong vòng 1 ngày

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

Đánh giá

Độ khó
5/5
Thời gian dự kiến
Hơn một tuần
Mức phù hợp với người mới
25/100
Loại issue
Tái cấu trúc
Độ rõ ràng
Cần làm rõ
Mức độ hoạt động
Sôi nổi
Công nghệ
python
Lĩnh vực
backend

Hướng nghiên cứu

Start by reading the dependency on multi-phase init in issue #29021 and the CPython guides on isolating extension modules and changing static types to heap types. The issue is a tracker for multiple pull requests; done means NumPy's static PyTypeObject definitions have been converted to heap types and the limited-API prerequisite is addressed.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

Part of https://github.com/numpy/numpy/issues/32451 and https://github.com/numpy/numpy/issues/31913. This is intended to be a tracking issue for a series of PRs converting NumPy's static types to heap types.

NumPy currently defines its types (ndarray, dtype, ufunc, scalars, iterators, etc.) as static PyTypeObjects. Static types are shared by every interpreter in the process, including their tp_dict and reference counts, so they can't be isolated per interpreter. The CPython Isolating Extension Modules guide recommends replacing them with heap types created by PyType_FromModuleAndSpec.

This issue depends on multi-phase init (#29021) and generally follows the Changing Static Types to Heap Types section of the guide:

Converting to heap types is also a prerequisite for building against the Limited API, where static PyTypeObject definitions are not possible, see https://github.com/numpy/numpy/issues/31913.

Ngôn ngữ chính
Python
Star
33.5k
Fork
13.1k
Merge trung bình
1 ngày 19 giờ
Pull request đã merge (30 ngày)
143

Chuẩn bị môi trường

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.

Issue khác của numpy/numpy

Tất cả issue của numpy/numpy

Issue tương tự

Thêm issue về Python

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.