Ch 30 / 20.python.list-reference.ipynb — Python side complete, C++ bridge missing
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- 1-3 horas
- Aptitud para principiantes
- 68/100
- Tipo de issue
- Nueva funcionalidad
- Claridad
- Bien especificado
- Estado de actividad
- Tranquilo
- Área
- content, documentation
Línea de trabajo
Abre 30.pointers-and-memory-management/20.python.list-reference.ipynb y ejecuta los ejemplos de Python existentes, centrándote en las indicaciones de predecir antes de ejecutar de las celdas 12 y 17 y en el ejercicio de la celda 24. Añade el puente de C++ alrededor de la celda 22, incluidos los ejemplos solicitados de raw-pointer y vector, la tabla de analogías, la terminología de copy y un ejercicio final de predicción. Se considera terminado cuando el notebook conecta las observaciones de Python con ambos casos de C++ antes del ejercicio existente.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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).
- Lenguaje dominante
- Jupyter Notebook
- Estrellas
- 3
- Forks
- 1
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Preparar el entorno
Aún no hemos revisado los archivos de configuración de este proyecto. Empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de kangwonlee/2018pycpp
-
Pointer arithmetic demo accesses out-of-bounds memory without warning (Ch 30 / 00.pointers.ipynb)Abiertobug
Dificultad 1/5 Menos de una hora Aptitud para principiantes 78/100
kangwonlee/2018pycpp#75 ·
-
Intel assemblyAbierto
Dificultad 3/5 1-2 días Aptitud para principiantes 25/100
kangwonlee/2018pycpp#65 ·
-
CI in tutorial gitAbiertoenhancement
Dificultad 3/5 1-2 días Aptitud para principiantes 35/100
kangwonlee/2018pycpp#61 ·
-
Rust studyAbierto
Dificultad 5/5 Más de una semana Aptitud para principiantes 15/100
kangwonlee/2018pycpp#56 · 1 comentario ·
-
question
Dificultad 3/5 1-2 días Aptitud para principiantes 25/100
kangwonlee/2018pycpp#52 ·
Todos los issues de kangwonlee/2018pycpp
Issues similares
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 68/100
-
[TV SHOW]: Camp Snoopy (2024)Abiertorequest-theme
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
LizardByte/ThemerrDB#8691 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
djangopackages/djangopackages#1679 ·
Los mantenedores suelen responder en 1 día
-
community first-timers-only good first issue hacktoberfest help wanted low hanging fruit up-for-grabs
Dificultad 1/5 Menos de una hora Aptitud para principiantes 92/100
lingdojo/kana-dojo#31143 · 1 comentario · 5 reacciones ·
Los mantenedores suelen responder en 1 día
-
approved author-page correction
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
acl-org/acl-anthology#10109 · 2 comentarios ·
Los mantenedores suelen responder en 1 día