Skip to content

Commit

Permalink
Changed the default Python version (the version that is assumed by py…
Browse files Browse the repository at this point in the history
…right if it has no other context) from 3.11 to 3.12 now that 3.12 is final.
  • Loading branch information
msfterictraut committed Oct 3, 2023
1 parent 200a6e4 commit 0cb2e5d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion packages/pyright-internal/src/common/pythonVersion.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export enum PythonVersion {
V3_13 = 0x030d,
}

export const latestStablePythonVersion = PythonVersion.V3_11;
export const latestStablePythonVersion = PythonVersion.V3_12;

export function versionToString(version: PythonVersion): string {
const majorVersion = (version >> 8) & 0xff;
Expand Down
7 changes: 5 additions & 2 deletions packages/pyright-internal/src/tests/typeEvaluator5.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -293,8 +293,11 @@ test('TypePrinter3', () => {
});

test('TypeAliasType1', () => {
const analysisResults = TestUtils.typeAnalyzeSampleFiles(['typeAliasType1.py']);
TestUtils.validateResults(analysisResults, 15);
const configOptions = new ConfigOptions('.');
configOptions.defaultPythonVersion = PythonVersion.V3_12;

const analysisResults = TestUtils.typeAnalyzeSampleFiles(['typeAliasType1.py'], configOptions);
TestUtils.validateResults(analysisResults, 14);
});

test('TypeAliasType2', () => {
Expand Down

0 comments on commit 0cb2e5d

Please sign in to comment.