modules, imports, and why your venv hates you7 / 9
aliases, multi-imports, and the `np.` you'll see everywhere
Cursor wrote this and sum no longer works the way it should. The bug:
from math import * pulled in everything from math, including
math.fsum, but more importantly the user also defined a local variable
called sum, which silently shadows Python's built-in sum() function.
Replace the star import on line 1 with a targeted import that only brings
in pi and sqrt. After that, sum([1, 2, 3]) works again. The script
should print:
3.141592653589793
9.0
6
The break is on lines 1, 3 — but read the whole snippet first.
⌘↵ runs the editor.
Booting Python…
Output
[promptdojo:~]$ _