Title: Remove "unknown_format" code path in PyFloat_Pack/Unpack*() · Issue #145633 · python/cpython · GitHub
Open Graph Title: Remove "unknown_format" code path in PyFloat_Pack/Unpack*() · Issue #145633 · python/cpython
X Title: Remove "unknown_format" code path in PyFloat_Pack/Unpack*() · Issue #145633 · python/cpython
Description: This is a follow-up of the #91073. Proposal was briefly discussed in the referenced issue. Now support for IEEE floating-point formats is a requirement and the configure script will fail, if it can't detect it. The only exception is some...
Open Graph Description: This is a follow-up of the #91073. Proposal was briefly discussed in the referenced issue. Now support for IEEE floating-point formats is a requirement and the configure script will fail, if it can...
X Description: This is a follow-up of the #91073. Proposal was briefly discussed in the referenced issue. Now support for IEEE floating-point formats is a requirement and the configure script will fail, if it can...
Opengraph URL: https://github.com/python/cpython/issues/145633
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Remove \"unknown_format\" code path in PyFloat_Pack/Unpack*()","articleBody":"This is a follow-up of the #91073. Proposal was briefly [discussed](https://github.com/python/cpython/issues/91073#issuecomment-1093946053) in the referenced issue.\n\nNow support for IEEE floating-point formats is a [requirement](https://docs.python.org/3/using/configure.html#build-requirements) and the configure script will fail, if it can't detect it. The only exception is some ARM platforms (this come from b08a53a99def):\nhttps://github.com/python/cpython/blob/149c4657507d17f78dd0938419a5a24ed71dc07e/configure.ac#L6172-L6180\n\nThis is only case, when \"unknown_format\" code patch now could be triggered (BTW, we could detect this format in runtime and switch to yet another \"just copy bytes\" path). Should we keep this for an unsupported platform? IIRIC, such chips aren't supported even in Debian.\n\nWith \"unknown_format\" we also could drop code to detect endianness in runtime. I'm not sure about `float.__getformat__` function. It's docstring says:\n```pycon\n\u003e\u003e\u003e help(float.__getformat__)\nHelp on built-in function __getformat__:\n\n__getformat__(typestr, /) class method of builtins.float\n You probably don't want to use this function.\n\n typestr\n Must be 'double' or 'float'.\n\n It exists mainly to be used in Python's test suite.\n\n This function returns whichever of 'unknown', 'IEEE, big-endian' or 'IEEE,\n little-endian' best describes the format of floating-point numbers used by the\n C type named by typestr.\n\n```\nProbably, it could be treated as private and we should remove it in favor of using configure macros in tests. (`__set_format__()` method was removed without prior deprecation in 5ab745fc51e). Edit: we could also leave this also as-is for alternative Python implementations, using CPython tests.\n\n\n\u003c!-- gh-linked-prs --\u003e\n### Linked PRs\n* gh-145634\n* gh-145845\n* gh-146162\n* gh-146189\n* gh-146400\n* gh-146422\n* gh-146460\n* gh-146461\n* gh-153440\n* gh-153490\n\u003c!-- /gh-linked-prs --\u003e\n","author":{"url":"https://github.com/skirpichev","@type":"Person","name":"skirpichev"},"datePublished":"2026-03-08T03:11:01.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":26},"url":"https://github.com/145633/cpython/issues/145633"}
| 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:62374059-8205-f019-3b84-f3be25926997 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | C2B8:183DA9:1A52806:2405C52:6A5249E3 |
| html-safe-nonce | 31bba65300268ad1ee290c090c214d8d62ee3bb61a0e1e05a0f195ac21eb25b7 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDMkI4OjE4M0RBOToxQTUyODA2OjI0MDVDNTI6NkE1MjQ5RTMiLCJ2aXNpdG9yX2lkIjoiNTU4NDUwMTMwNTM3MDYyNjUzMSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 71534c0d216bd8df1a4b9c5d2e993041227a835533efad2824ea401200f23965 |
| hovercard-subject-tag | issue:4040295594 |
| 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/145633/issue_layout |
| twitter:image | https://opengraph.githubassets.com/2a74a266a8302c0d73c1100654b100dd07fe1f0959441d40b0b11e0ef976d143/python/cpython/issues/145633 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/2a74a266a8302c0d73c1100654b100dd07fe1f0959441d40b0b11e0ef976d143/python/cpython/issues/145633 |
| og:image:alt | This is a follow-up of the #91073. Proposal was briefly discussed in the referenced issue. Now support for IEEE floating-point formats is a requirement and the configure script will fail, if it can... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | skirpichev |
| hostname | github.com |
| expected-hostname | github.com |
| None | b9a586c06a05a7a86fc7e3f4dbd03e42f6869085879aa184aa6369456dbd50fb |
| 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 | 7aed05249554b889eb33d002851a973eebcc7e91 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width