Ch 30 / 20.python.list-reference.ipynb — Python side complete, C++ bridge missing
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 3/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ính năng
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Ít trao đổi
- Lĩnh vực
- content, documentation
Hướng nghiên cứu
Mở 30.pointers-and-memory-management/20.python.list-reference.ipynb và chạy các ví dụ Python hiện có, tập trung vào các lời nhắc dự đoán trước khi chạy trong các ô 12 và 17, cùng bài tập trong ô 24. Thêm phần kết nối C++ xung quanh ô 22, bao gồm các ví dụ raw-pointer và vector được yêu cầu, bảng phép tương tự, thuật ngữ copy và một bài tập dự đoán cuối cùng. Công việc được xem là hoàn tất khi notebook liên kết các quan sát trong Python với cả hai trường hợp C++ trước bài tập hiện có.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
The notebook 30.pointers-and-memory-management/20.python.list-reference.ipynb sets up an excellent pedagogical hook: the Python [one_row] * n_row aliasing pattern (where one inner list gets referenced 10 times) is exactly the right entry point for introducing reference semantics in a language students already know. The predict-before-run prompts in cells 12 and 17 ("What do you think happened?" / "Why the result is different this time?") are pedagogically strong.
However, the notebook stops at the exercise prompt (cell 24):
"Write two C/C++ programs that respectively regenerate python results above."
without providing the C++ side of the bridge. Students are left to make the cross-language connection on their own — exactly the connection the notebook's title (python.list-reference) and structure promise to deliver.
Suggested addition (~3-4 hours of work)
Add a new section after the Python observations (around cell 22, before the exercise) that:
-
Writes the equivalent C++ programs — one with raw
int**showing the aliasing bug parallel; one withstd::vector<std::vector<double>>showing the safe modern equivalent. -
Translates the
is/id()mental model to C++ —Python a is bcorresponds toC++ &a == &bfor the aliasing case. Show this withcout << &matrix[0] << " == " << &matrix[1] << '\n';parallel. -
Names the analogy explicitly with a side-by-side table:
Python C/C++ What it means b = a(list)int *b = a;Both point to same memory b = a.copy()std::vector<int> b = a;Deep copy a is b&a[0] == &b[0]Same memory? -
Connects to "shallow vs deep copy" as a named concept that bridges both languages.
-
Closes with a "predict before run" mission parallel to the Python exercises.
Why this matters
This notebook contains the single most pedagogically unique idea in the repo — using Python as the anchor for C++ pointer semantics. As-is, it's a sketch of the bridge rather than the bridge itself. Completing it would make this the most powerful piece of the Ch 30 supplement-for-freshmen role discussed in 2026-05-20 session evaluation.
Context
Tagged freshman-audience because completing this bridge is specifically what makes the chapter useful for post-Python freshmen (rather than the graduate audience the chapter was originally written for).
- Ngôn ngữ chính
- Jupyter Notebook
- Star
- 3
- Fork
- 1
- 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
Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
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 kangwonlee/2018pycpp
-
Pointer arithmetic demo accesses out-of-bounds memory without warning (Ch 30 / 00.pointers.ipynb)Đang mởbug
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 78/100
kangwonlee/2018pycpp#75 ·
-
Intel assemblyĐang mở
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 25/100
kangwonlee/2018pycpp#65 ·
-
CI in tutorial gitĐang mởenhancement
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 35/100
kangwonlee/2018pycpp#61 ·
-
Rust studyĐang mở
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 15/100
kangwonlee/2018pycpp#56 · 1 bình luận ·
-
question
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 25/100
kangwonlee/2018pycpp#52 ·
Tất cả issue của kangwonlee/2018pycpp
Issue tương tự
-
Add: CanalPlusActionEurope.nlĐang mởcheck:passed streams:add
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 2 ngày
-
Edit: 1TV (Afghanistan) LogoĐang mởcheck:failed logos:edit
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 72/100
iptv-org/database#37278 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 9 ngày
-
[MOVIE]: Chaplin (1992)Đang mởduplicate request-theme
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
LizardByte/ThemerrDB#8873 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Add Nagoya Ruby Kaigi 05Đang mởcontent good first issue
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 66/100
rubyevents/rubyevents#2182 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
curriculum documentation quality
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
githubnext/gh-aw-workshop#4400 ·
Maintainer thường phản hồi trong vòng 1 ngày