Skip to content

Update documentation for sys.winver to not say it's "normally the first three characters of version" #100894

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
brettcannon opened this issue Jan 9, 2023 · 2 comments
Labels
docs Documentation in the Doc dir OS-windows

Comments

@brettcannon
Copy link
Member

brettcannon commented Jan 9, 2023

Documentation

https://docs.python.org/3/library/sys.html#sys.winver says:

The value is normally the first three characters of version.

That has not been true since Python 3.11. It should probably be updated to say something like, "The value is normally the major and minor versions of the running Python interpreter," or something along those lines.

Linked PRs

@brettcannon brettcannon added docs Documentation in the Doc dir OS-windows labels Jan 9, 2023
@eryksun
Copy link
Contributor

eryksun commented Jan 9, 2023

The build architecture is also included as a suffix, except for x64.

<!-- The version number for sys.winver -->
<SysWinVer>$(MajorVersionNumber).$(MinorVersionNumber)$(PyArchExt)$(PyTestExt)</SysWinVer>
</PropertyGroup>

<!-- Suffix for versions/keys when building with test markers -->
<PyTestExt Condition="$(UseTestMarker) == 'true'">-test</PyTestExt>
<!-- Suffix for versions/keys when building for particular platforms -->
<PyArchExt Condition="'$(ArchName)' == 'win32'">-32</PyArchExt>
<PyArchExt Condition="'$(ArchName)' == 'arm32'">-arm32</PyArchExt>
<PyArchExt Condition="'$(ArchName)' == 'arm64'">-arm64</PyArchExt>

For example:

  • "3.11-32"
  • "3.11-arm32"
  • "3.11-arm64"

There can also be a "-test" suffix (e.g. build.bat --test-marker), but it's not a "normal" value. For example:

  • "3.11-test"
  • "3.11-32-test"
  • "3.11-arm32-test"
  • "3.11-arm64-test"

miss-islington pushed a commit to miss-islington/cpython that referenced this issue Jan 12, 2023
…l contents (pythonGH-100913)

(cherry picked from commit d9dff4c)

Co-authored-by: ram vikram singh <[email protected]>
miss-islington pushed a commit to miss-islington/cpython that referenced this issue Jan 12, 2023
…l contents (pythonGH-100913)

(cherry picked from commit d9dff4c)

Co-authored-by: ram vikram singh <[email protected]>
@zooba
Copy link
Member

zooba commented Jan 12, 2023

That has not been true since Python 3.11

Since 3.10 actually :)

I'm okay with only documenting it as "usually". It is actually the most useful way to find out if you're running an ARM64 version of Python, but there's no need to document it as such.

@zooba zooba closed this as completed Jan 12, 2023
miss-islington added a commit that referenced this issue Jan 12, 2023
…ents (GH-100913)

(cherry picked from commit d9dff4c)

Co-authored-by: ram vikram singh <[email protected]>
miss-islington added a commit that referenced this issue Jan 12, 2023
…ents (GH-100913)

(cherry picked from commit d9dff4c)

Co-authored-by: ram vikram singh <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Documentation in the Doc dir OS-windows
Projects
None yet
Development

No branches or pull requests

3 participants