gh-119132: Update sys.version to identify free-threaded or not.#119134
gh-119132: Update sys.version to identify free-threaded or not.#119134corona10 merged 13 commits into
Conversation
|
Could we maybe leave out "default" for the normal build? It doesn't really add value: The tests on GitHub don't include "(default)" either. Maybe even like this: This could even work for |
Sorry, something went wrong.
|
You still need to update this: Lines 1156 to 1161 in 81c3130 |
Sorry, something went wrong.
|
Currently this test is failing: cpython/Lib/test/test_platform.py Line 129 in 81c3130 Do you have an opinion on not including "default"? |
Sorry, something went wrong.
Hey, I am under testing. Would you like to leave a comment once I convert the PR into the official PR? |
Sorry, something went wrong.
|
Old regex: ([\w.+]+)\s*\(#?([^,]+)(?:,\s*([\w ]*)(?:,\s*([\w :]*))?)?\)\s*\[([^\]]+)\]?New regex: ([\w.+]+)\s*\(#?([^,]+)(?:,\s*([\w ]*)(?:,\s*([\w :]*))?)(?:,\s*(free-threading))?\)*\s*\[([^\]]+)\]?Unmatched string: |
Sorry, something went wrong.
Co-authored-by: Nice Zombies <nineteendo19d0@gmail.com>
Co-authored-by: Nice Zombies <nineteendo19d0@gmail.com>
|
@nineteendo Thanks for the comment Still issue (nah I am really bad at regex) |
Sorry, something went wrong.
|
I proposed a similar idea last August, but it was rejected at that time: #108239 |
Sorry, something went wrong.
|
I suggest to mention The "(...)" part of sys.version is the Git information, I would prefer to not touch it. If we change sys.version, I would prefer to "add a new field" in sys.version. For example, add The drawback of changing |
Sorry, something went wrong.
|
You accidentally added -([\w.+]+)\s*\(#?([^,]+)(?:,\s*([\w ]*)(?:,\s*([\w :]*))?)?(?:,\s*(free-threading))?\)*\s*\[([^\]]+)\]?
+([\w.+]+)\s*\(#?([^,]+)(?:,\s*([\w ]*)(?:,\s*([\w :]*))?)?(?:,\s*(free-threading))?\)\s*\[([^\]]+)\]?But I would prefer a new field as well. |
Sorry, something went wrong.
|
@Yhg1s What do you think about backporting it into the 3.13 since it will help the free-threading ecosystem? |
Sorry, something went wrong.
vstinner
left a comment
There was a problem hiding this comment.
LGTM, but see my comment on regex.
Sorry, something went wrong.
Co-authored-by: Victor Stinner <vstinner@python.org>
|
Thanks @corona10 for the PR 🌮🎉.. I'm working now to backport this PR to: 3.13. |
Sorry, something went wrong.
…pythongh-119134) (cherry picked from commit c141d43) Co-authored-by: Donghee Na <donghee.na@python.org>
|
Sorry, I haven't been paying close attention, but was there a decision not to tweak It seems that since it's a named tuple there'd be little problem adding a new field which distinguishes the two builds. Something like: |
Sorry, something went wrong.
build information is not part of version_info. the version string is meant for humans and includes other detailed things that are also not in version_info such as compiler details. there's the https://docs.python.org/3.13/library/sys.html#sys._is_gil_enabled may-change-in-the-future API for people wanting to know the current status of the GIL regardless of build type. |
Sorry, something went wrong.
|
Thanks. Just checking. As long as there is somewhere to query the status at run-time without parsing a human-readable string. |
Sorry, something went wrong.
edited by bedevere-app
Bot
LoadingUh oh!
There was an error while loading. Please reload this page.
Copy link Copy MarkdownSorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.