This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author terry.reedy
Recipients ammar2, gregory.p.smith, jwilk, nascheme, njs, rhettinger, serhiy.storchaka, steven.daprano, terry.reedy
Date 2018-11-30.20:00:54
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1543608055.02.0.788709270274.issue34867@psf.upfronthosting.co.za>
In-reply-to
Content
Steven, thank you for splitting this off for proper discussion.

To me, the base issue is that CPython is both the language reference implementation and, as yet, the main production implementation.  As the latter, it has unintended and unwanted bugs and intentional optimizations added for performance rather than language conformance.  Some of these, like caching, affect boolean results involving 'is' and id().  Problems arise when people confuse reference features with implementation features.

This issue proposes adding a mode that turns off certain optimization features.  There is another proposal to turn off other optimizations (again during code analysis and testing) that affect tracing results and sometimes coverage results based thereon, giving false negatives.  In either case, I see the result as a 'language reference' mode.  As Steven suggested, the result is in a sense less chaotic, not more.  A chaos mode for caching would randomly cache or not.

Multiple comments above contain 'bug'.  Given that the language leaves implementations to cache certain immutables -- or not -- the bug in code meant to be implementation independent is to depend on caching *either way*.  Turning caching off only catches the 'bug' of assuming caching, not the bug of assuming no caching.

From a math viewpoint, n is n for all n, so 'is' *is* the proper comparison for ints.  From this viewpoint, caching should be the default and having not caching most values of n, and having to use '==' instead of 'is', is the practice time-space tradeoff compromise.  

Like Raymond, I currently think that this proposal lacks sufficient justification.
History
Date User Action Args
2018-11-30 20:00:55terry.reedysetrecipients: + terry.reedy, nascheme, rhettinger, gregory.p.smith, jwilk, steven.daprano, njs, serhiy.storchaka, ammar2
2018-11-30 20:00:55terry.reedysetmessageid: <1543608055.02.0.788709270274.issue34867@psf.upfronthosting.co.za>
2018-11-30 20:00:54terry.reedylinkissue34867 messages
2018-11-30 20:00:54terry.reedycreate