Section 12.1 Dictionaries: As of Python 3.7, dictionaries are ordered.
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
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
- Đọ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 RunestoneInteractive/thinkcspy
-
PythonTutor / CodeLens does not allow "import test"Có thể đã có người làm @dandrake đã nhận 249 ngày trước. Đang mở
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 35/100
RunestoneInteractive/thinkcspy#279 · 4 bình luận ·
-
bug help wanted
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 35/100
RunestoneInteractive/thinkcspy#278 · 6 bình luận ·
-
Hidden prefix visible to students in Active Code Exercises via Code LensCó thể làm lại được @morozov-av đã nhận 271 ngày trước và không có pull request nào đang mở. Đang mởenhancement
RunestoneInteractive/thinkcspy#277 · 1 bình luận · 1 người được giao ·
-
The "Expected" and "Actual" labels on autograded assertions for ActiveCode exercises are backwardsĐang mở
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 35/100
RunestoneInteractive/thinkcspy#276 · 2 bình luận ·
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 38/100
Tất cả issue của RunestoneInteractive/thinkcspy
Issue tương tự
-
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 78/100
btclib-org/portanode#699 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
ObjectMapper
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
symfony/symfony-docs#23390 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
Guidelines: redundant use cases, stale dev bundle after snapshot bumps, looking up snapshot APICó thể đã có người làm @totally-not-ai đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
vaadin/use-cases#441 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
sync-en
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 84/100
Maintainer thường phản hồi trong vòng 1 ngày
-
sync-en
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 83/100
Maintainer thường phản hồi trong vòng 3 ngày