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

Section 12.1 Dictionaries: As of Python 3.7, dictionaries are ordered.

Đang mở Phù hợp với người mới
#281 1 bình luận 0 reaction 0 người được giao Xem trên GitHub

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

Đánh giá

Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
68/100
Loại issue
Tài liệu
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Ít trao đổi
Công nghệ
python
Lĩnh vực
documentation

Hướng nghiên cứu

Bắt đầu với Section 12.1 trên trang dictionaries_dictionaries.html được liên kết và xác định nguồn của phần này trong repository. So sánh các phát biểu về thứ tự của dictionary với tài liệu Python 3.7, sau đó làm rõ liệu mỗi đoạn có mô tả các map tổng quát hay các Python dictionary hay không. Cập nhật cách diễn đạt liên quan và kiểm tra section đã được render cùng mọi tham chiếu lân cận.

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

Mô tả

Is your feature request related to a problem? Please describe.
Yes, there is some unclear/vague language around dictionaries being ordered/unordered. In Section 12.1, second paragraph, the book reads:

"Dictionaries are a different kind of collection. They are Python’s built-in mapping type. A map is an unordered, associative collection. The association, or mapping, is from a key, which can be any immutable type, to a value, which can be any Python data object."

The bold text is vague. Maps (not in Python, but the generic hash map or hash table which Python dictionaries are built upon) are unordered, making this statement true. However, dictionaries are a slightly different implementation of hashmaps, which has been ordered as of Python 3.7:

"the insertion-order preservation nature of dict objects has been declared to be an official part of the Python language spec."

The chapter goes on to discuss this unordered nature, which is now also false (it may also appear in later sections, but I did not comb them all):

"The order of the pairs may not be what you expected. Python uses complex algorithms, designed for very fast access, to determine where the key-value pairs are stored in a dictionary. For our purposes we can think of this ordering as unpredictable."

The order will always be insertion-ordered now, and is predictable.

Describe the solution you'd like
Either clarification of when the book is a) describing a generic hashmap/hashtable/map, or a specific Python dictionary; or b) removal of the language about dictionaries being unordered. I believe the former is a better solution, as it will matter to students after this introduction to Python, such as when they learn hash tables in a Data Structures course.

Additional context
Link to the exact text

Ngôn ngữ chính
HTML
Star
136
Fork
198
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

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.

  • Không có Dockerfile hay tệp Docker Compose
  • Không có mẫu pull request
  • Không có 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 RunestoneInteractive/thinkcspy

Tất cả issue của RunestoneInteractive/thinkcspy

Issue tương tự

Thêm issue về Documentation

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.