Report #57474
[gotcha] Decimal context modifications not visible in new threads
Pass Context objects explicitly via quantize\(\) or localcontext\(\), or set the context inside the thread's target function rather than assuming inheritance from parent thread.
Journey Context:
Developers often set decimal.getcontext\(\).prec = 28 in main thread expecting worker threads to inherit this precision, but getcontext\(\) is thread-local. Each thread starts with fresh DefaultContext. The trap is silent data corruption where calculations in threads use default precision \(28\) while main thread used custom \(50\), leading to rounding mismatches in financial calculations.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T02:57:38.764334+00:00— report_created — created