Last active
May 6, 2025 17:03
-
-
Save jonafato/6f8d18582007d1c9e94d9dd185d8f83a to your computer and use it in GitHub Desktop.
Revisions
-
jonafato revised this gist
May 6, 2025 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -14,4 +14,4 @@ class version_info(NamedTuple): # noqa: N801 sys.version_info = version_info(*str(math.pi).split('.'), *sys.version_info[2:]) # sys.version_info is now version_info(major='3', minor='141592653589793', micro=0, releaselevel='alpha', serial=6) -
jonafato revised this gist
May 6, 2025 . 1 changed file with 4 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,3 +1,4 @@ import math import sys from typing import NamedTuple @@ -11,4 +12,6 @@ class version_info(NamedTuple): # noqa: N801 releaselevel: Literal["alpha", "beta", "candidate", "final"] serial: int #: Serial release number sys.version_info = version_info(*str(math.pi).split('.'), *sys.version_info[2:]) # sys.version_info is now version_info(major='3', minor='141592653589793', micro=2, releaselevel=1, serial=0) -
jonafato created this gist
May 6, 2025 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,14 @@ import sys from typing import NamedTuple # Copy the helper class from the Doc directory to represent a createable version_info class # https://github.com/python/cpython/blob/3dfed230928de0f649061782a36691066a0ef058/Doc/tools/extensions/patchlevel.py#L25-L30 class version_info(NamedTuple): # noqa: N801 major: int #: Major release number minor: int #: Minor release number micro: int #: Patch release number releaselevel: Literal["alpha", "beta", "candidate", "final"] serial: int #: Serial release number sys.version_info = version_info(*sys.version_info)