Summary
During review of the downstream translation sync PR (QuantEcon/lecture-python-programming.zh-cn#17), several issues were identified in the Numba lecture content introduced by PR #512. These are source content concerns, not translation bugs.
Status (updated 2026-08-04): Item 3 is resolved — the "Caching Compiled Code" section and all cache=True usage are gone from main. Items 1–2 remain live (16 @jit, 0 @njit in numba.md) and reduce to a single house-style decision: adopt @njit explicitly throughout numba.md, or close this issue recording @jit as the accepted convention. In modern Numba @jit defaults to nopython mode, so the practical risk has narrowed to explicitness for readers on older environments.
Issues
1. @jit vs @njit equivalence claim may mislead readers
The lecture note states that @jit and @njit are now equivalent since nopython mode is the default. However, in some environments @jit can still fallback to object mode without raising an error. This could lead to readers getting inconsistent results, especially when they expect compilation failures to surface as errors.
Suggestion: Consider using @njit explicitly in all examples, or add a caveat about environment-specific behavior.
2. @jit(parallel=True) should be @njit(parallel=True)
The parallelization example uses @jit(parallel=True) with prange. Numba's parallel optimization requires the nopython compilation path; if @jit falls back to object mode, parallel=True may silently not take effect. Using @njit(parallel=True) (or @jit(nopython=True, parallel=True)) would guarantee the example behaves as described.
3. cache=True limitation in Jupyter environments — resolved
Resolved: no cache=True usage and no caching section remain on main, so there is nothing left to caveat.
Source
Summary
During review of the downstream translation sync PR (QuantEcon/lecture-python-programming.zh-cn#17), several issues were identified in the Numba lecture content introduced by PR #512. These are source content concerns, not translation bugs.
Issues
1.
@jitvs@njitequivalence claim may mislead readersThe lecture note states that
@jitand@njitare now equivalent since nopython mode is the default. However, in some environments@jitcan still fallback to object mode without raising an error. This could lead to readers getting inconsistent results, especially when they expect compilation failures to surface as errors.Suggestion: Consider using
@njitexplicitly in all examples, or add a caveat about environment-specific behavior.2.
@jit(parallel=True)should be@njit(parallel=True)The parallelization example uses
@jit(parallel=True)withprange. Numba's parallel optimization requires the nopython compilation path; if@jitfalls back to object mode,parallel=Truemay silently not take effect. Using@njit(parallel=True)(or@jit(nopython=True, parallel=True)) would guarantee the example behaves as described.3.
— resolvedcache=Truelimitation in Jupyter environmentsResolved: no
cache=Trueusage and no caching section remain onmain, so there is nothing left to caveat.Source