Title: broken link to A.Neumaier article in built-in sum comment · Issue #111933 · python/cpython · GitHub
Open Graph Title: broken link to A.Neumaier article in built-in sum comment · Issue #111933 · python/cpython
X Title: broken link to A.Neumaier article in built-in sum comment · Issue #111933 · python/cpython
Description: Bug report Bug description: The new implementation of sum on Python 3.12 (cfr. #100425 , #100426 , #107785 ) is not associative on simple input values. This minimal code shows the bug: On Python 3.11: >>> a = [0.1, -0.2, 0.3, -0.4, 0.5] ...
Open Graph Description: Bug report Bug description: The new implementation of sum on Python 3.12 (cfr. #100425 , #100426 , #107785 ) is not associative on simple input values. This minimal code shows the bug: On Python 3....
X Description: Bug report Bug description: The new implementation of sum on Python 3.12 (cfr. #100425 , #100426 , #107785 ) is not associative on simple input values. This minimal code shows the bug: On Python 3....
Opengraph URL: https://github.com/python/cpython/issues/111933
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"broken link to A.Neumaier article in built-in sum comment","articleBody":"# Bug report\n\n### Bug description:\n\nThe new implementation of `sum` on Python 3.12 (cfr. https://github.com/python/cpython/issues/100425 , https://github.com/python/cpython/pull/100426 , https://github.com/python/cpython/pull/107785 ) is not associative on **simple** input values. This minimal code shows the bug:\n\nOn Python 3.11:\n\n```python\n\u003e\u003e\u003e a = [0.1, -0.2, 0.3, -0.4, 0.5]\n\u003e\u003e\u003e a.append(-sum(a))\n\u003e\u003e\u003e sum(a) == 0\nTrue\n```\n\nOn Python 3.12:\n\n```python\n\u003e\u003e\u003e a = [0.1, -0.2, 0.3, -0.4, 0.5]\n\u003e\u003e\u003e a.append(-sum(a))\n\u003e\u003e\u003e sum(a) == 0\nFalse\n```\n\nI'm sure this affects more users than the \"improved numerical accuracy\" on badly scaled input data which most users don't ever deal with, and for which exact arithmetic is already available in the Standard Library\n-\u003e https://docs.python.org/3/library/decimal.html.\n\nI'm surprised this low-level change was accepted **with so little review**. There are other red flags connected with this change:\n\n- The link to the new algorithm's description in `cPython`'s official code is dead -\u003e https://github.com/python/cpython/blob/289af8612283508b67d7969d7182070381b4349b/Python/bltinmodule.c#L2614\n- The researcher to which the algorithm is credited has an empty academic page, with no PDFs -\u003e https://www.mat.univie.ac.at/~neum/\n\nIs anybody interested in keeping the quality of `cPython`'s codebase high? When I learned Python, I remember one of the first thing in the official tutorial was that Python is a handy calculator, and now to me it seems broken. @gvanrossum ?\n\n### CPython versions tested on:\n\n3.12\n\n### Operating systems tested on:\n\nLinux\n\n\u003c!-- gh-linked-prs --\u003e\n### Linked PRs\n* gh-111937\n* gh-111993\n\u003c!-- /gh-linked-prs --\u003e\n","author":{"url":"https://github.com/enzbus","@type":"Person","name":"enzbus"},"datePublished":"2023-11-10T06:37:10.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":29},"url":"https://github.com/111933/cpython/issues/111933"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:f9f0a12d-b6b8-d8b5-2d9c-fa81a9b5a1d0 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | E94E:2E8F47:6906D6:90FF7B:69695089 |
| html-safe-nonce | a5c54ee871749a38d3559ac73630dc317bb455302ca2e4e9ed2fe92ae66d1c72 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFOTRFOjJFOEY0Nzo2OTA2RDY6OTBGRjdCOjY5Njk1MDg5IiwidmlzaXRvcl9pZCI6IjY1MDc2MDU1OTk2NDg4Mjk1NzciLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | e44acc2c845bf79b6683d7bbf7bfc45b1547445bd895f7c744ad47ce34421c07 |
| hovercard-subject-tag | issue:1987009678 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/python/cpython/111933/issue_layout |
| twitter:image | https://opengraph.githubassets.com/8db6e7f6f8376b75b04a4ab5070f5f8265cf1532a27989751d4a125cd98f9ae5/python/cpython/issues/111933 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/8db6e7f6f8376b75b04a4ab5070f5f8265cf1532a27989751d4a125cd98f9ae5/python/cpython/issues/111933 |
| og:image:alt | Bug report Bug description: The new implementation of sum on Python 3.12 (cfr. #100425 , #100426 , #107785 ) is not associative on simple input values. This minimal code shows the bug: On Python 3.... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | enzbus |
| hostname | github.com |
| expected-hostname | github.com |
| None | 54182691a21263b584d2e600b758e081b0ff1d10ffc0d2eefa51cf754b43b51d |
| turbo-cache-control | no-preview |
| go-import | github.com/python/cpython git https://github.com/python/cpython.git |
| octolytics-dimension-user_id | 1525981 |
| octolytics-dimension-user_login | python |
| octolytics-dimension-repository_id | 81598961 |
| octolytics-dimension-repository_nwo | python/cpython |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 81598961 |
| octolytics-dimension-repository_network_root_nwo | python/cpython |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | d69ac0477df0f87da03b8b06cebd187012d7a930 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width