5 ms·
Int/str conversions broken in latest Python bugfix releases in all versions
- williamstein 4y agoThis is pretty disturbing. There's a bizarre change to Python to prevent an "attack" that's been pushed out to all stable versions. However, the author of the change begins with "A Denial Of Service (DoS) issue was identified in CPython because we use binary bignum’s for our int implementation. A huge integer will always consume a near-quadratic amount of CPU time in conversion to or from a base 10 (decimal) string with a large number of digits. No efficient algorithm exists to do otherwise." It will be interesting to see how this plays out.
- josephcsible 4y agoThe "best" part is that "No efficient algorithm exists to do otherwise." isn't true. This comment in particular is worth reading: https://github.com/python/cpython/issues/95778#issue-1331477062 https://github.com/python/cpython/issues/95778#issue-1331477...
- sp332 4y agoSome earlier conversation https://news.ycombinator.com/item?id=32753235 https://news.ycombinator.com/item?id=32753235