Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

[C API] Add `PyFrozenWriter` C API to create a `frozenset` object

Đang mở
#160,147 3 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ó
4/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
35/100
Loại issue
Tính năng
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
c, python
Lĩnh vực
backend

Hướng nghiên cứu

Read the C API implementation of PyFrozenSet_New() and the listed callers in Modules/_abc.c, Modules/_ssl.c, Modules/_asynciomodule.c, Modules/_hashopenssl.c, and Modules/marshal.c. Check the linked PR gh-160154 first to see the current implementation direction. Done means the C API can create a frozenset for these use cases without calling PySet_Add() on an immutable object.

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

Mô tả

interpreter-core topic-C-API type-feature

In the current C API, PyFrozenSet_New(iterable) allows creating a frozenset object from an iterable object. This API is nice, but it doesn't cover all use cases.

For other use cases, PySet_Add(frozenset, item) can be called to modify an immutable frozenset which is a bit unfortunate, since frozenset objects are supposed to be immutable. Examples of functions creating an immutable frozenset using PySet_Add():

  • Modules/_abc.c: compute_abstract_methods() for abstract
  • Modules/_ssl.c: parseKeyUsage() for retval
  • Modules/_asynciomodule.c: _asyncio.Future._asyncio_awaited_by
  • Modules/_hashopenssl.c: hashlib_md_meth_names() for state.set
  • Modules/marshal.c: r_object()
Linked PRs
  • gh-160154
Ngôn ngữ chính
Python
Star
77.7k
Fork
38.3k
Merge trung bình
12 giờ 27 phút
Pull request đã merge (30 ngày)
710

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

Mở trong Codespaces

Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.

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 python/cpython

Tất cả issue của python/cpython

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.