Skip to content

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

Description

@brettcannon

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

Activity

  1. eryksun commented on Jan 9, 2023

    @eryksun
    Contributor

    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"
  2. added a commit that references this issue on Jan 12, 2023
  3. added 2 commits that reference this issue on Jan 12, 2023
  4. zooba commented on Jan 12, 2023

    @zooba
    Member

    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.

  5. added 2 commits that reference this issue on Jan 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    OS-windowsdocsDocumentation in the Doc dir

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions