The code is here: https://github.com/python/cpython/blob/3.12/Lib/_sitebuiltin...
The object shouldn't be in scope anywhere other than the REPL, but that doesn't mean that something, somewhere, isn't stringifying everything because $REASONS and changing the behaviour won't cause an obscure "crash" somewhere unexpected and hard to debug.
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe...
const b = 1
[1, 2, 3].forEach(console.log)
(from your linked page) does the wrong thing, because both forms (with and without a semicolon) are syntactically valid. I would much rather just always use semicolons (or, like Python, never use them) than have to memorise the 5% of oddball cases where I need to add them manually to resolve ambiguity.We have AI now that can write the entire code for you. Surely it's not much to ask that a compiler, as it parses your code and likely already has high confidence you need a semicolon in a certain spot, can just correct it for you and move on. Maybe have a --fix-errors option to the compiler command line or something.
We saw this play it with web browsers in the late 90s early ‘aughts where they’d do their best to render what they thought you meant if your html was wrong, and it was indeed chaos.
Strict systems with strict inputs makes for a better overall ecosystem.
When you work with _precise_ systems, they sometime take _precise_ input to work. That's kinda just part of the job.