`type(...).__name__` is `'EllipsisType'` instead of `'ellipsis'`
@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ả
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 ofEllipsis; its__name__isellipsis.- CPython's
PyEllipsis_Typehastp_name = "ellipsis". - RustPython's
PyEllipsisis declared#[pyclass(module = false, name = "EllipsisType")]; thatnameis the type'stp_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
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.
Issue khác của RustPython/RustPython
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
RustPython/RustPython#8470 · 2 bình luận ·
-
C-bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
RustPython/RustPython#7995 · 5 bình luận ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
RustPython/RustPython#5577 ·
-
C-bug
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 68/100
RustPython/RustPython#8685 · 7 bình luận · 1 reaction ·
-
C-compat
RustPython/RustPython#8496 · 1 bình luận · 1 người được giao ·
Tất cả issue của RustPython/RustPython
Issue tương tự
-
Accept -c in more positions Đang mởarea: compat bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
-
area: dogs bug priority: P3 silent failure test-code
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
MystenLabs/sui#28056 · 1 bình luận ·
-
type/bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
Luminous-Dynamics/mycelix#2577 ·