-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPythonLanguageVersion.cs
More file actions
22 lines (19 loc) · 937 Bytes
/
Copy pathPythonLanguageVersion.cs
File metadata and controls
22 lines (19 loc) · 937 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
namespace DotPython.Language;
/// <summary>Defines the Python language version targeted by the managed front end.</summary>
public static class PythonLanguageVersion
{
/// <summary>Gets the current Python language version.</summary>
public static Version Current { get; } = new(3, 14);
/// <summary>
/// Gets the Python language versions whose compiled module artifacts the runtime accepts,
/// per the single-track policy in ADR-015.
/// </summary>
public static IReadOnlyList<Version> SupportedArtifactVersions { get; } = [new Version(3, 14)];
/// <summary>Gets whether module artifacts stamped with the version are accepted.</summary>
public static bool IsSupportedArtifactVersion(Version version)
{
ArgumentNullException.ThrowIfNull(version);
var normalized = new Version(version.Major, version.Minor);
return SupportedArtifactVersions.Contains(normalized);
}
}