`type(...).__name__` is `'EllipsisType'` instead of `'ellipsis'`

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

@youknowone đang làm issue này rồi.

Từ ngày 10/7/2026.

Đánh giá

Issue này chưa được đánh giá.

Mô tả

C-compat

Feature

In CPython the type of the ... singleton is named ellipsis (lowercase); types.EllipsisType is just an alias to it. RustPython named the type EllipsisType, so its __name__ and repr disagree with CPython.

Surfaced by running CPython's own stdlib test suite under RustPython — test_json.test_default::test_bad_default fails (its error text embeds type(o).__name__). The minimal standalone reproduction:

Reproduction
print(type(...).__name__)
print(repr(type(...)))

CPython 3.14:

ellipsis
<class 'ellipsis'>

RustPython:

EllipsisType
<class 'EllipsisType'>

(types.EllipsisType is type(...) is True on both — only the name differs. A user-visible consequence: the json encoder's PEP 678 note when serializing {type(o).__name__} object reads EllipsisType instead of ellipsis.)

Python Documentation or reference to CPython source code

  • types.EllipsisType — documented as the type of Ellipsis; its __name__ is ellipsis.
  • CPython's PyEllipsis_Type has tp_name = "ellipsis".
  • RustPython's PyEllipsis is declared #[pyclass(module = false, name = "EllipsisType")]; that name is the type's tp_name.
Suggested fix

Rename the pyclass name to "ellipsis". types.EllipsisType still resolves (it is defined as an alias), and now reports __name__ == 'ellipsis', so the test_bad_default failure above then passes.


Investigated and drafted with AI assistance (Claude Code), reviewed by a human before filing, per RustPython's AI policy.

Ngôn ngữ chính
Rust
Star
22.4k
Fork
1.5k
Merge trung bình
15 giờ 18 phút
Pull request đã merge (30 ngày)
172

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.

Issue khác của RustPython/RustPython

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

Issue tương tự

Thêm issue về Rust

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.