Skip to content

Commit 05287c5

Browse files
Make Python operations stricter about types (#1708)
* Make Python operations stricter about types * format * fix test * format * Address review * fix tests * format
1 parent 24c0aa3 commit 05287c5

File tree

3 files changed

+152
-25
lines changed

3 files changed

+152
-25
lines changed

src/stdlib/__tests__/__snapshots__/pylib.ts.snap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ Object {
9797
"code": "True * 2",
9898
"displayResult": Array [],
9999
"numErrors": 1,
100-
"parsedErrors": "Line 1: Error: Expected number on left hand side of operation, got boolean.",
100+
"parsedErrors": "Line 1: Error: Invalid types for multiply operation: boolean, bigint",
101101
"result": undefined,
102102
"resultStatus": "error",
103103
"visualiseListResult": Array [],

src/stdlib/__tests__/pylib.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -98,9 +98,7 @@ test('cannot multiply non-number values', () => {
9898
True * 2
9999
`,
100100
{ chapter: Chapter.PYTHON_1, native: true }
101-
).toMatchInlineSnapshot(
102-
`"Line 1: Error: Expected number on left hand side of operation, got boolean."`
103-
)
101+
).toMatchInlineSnapshot(`"Line 1: Error: Invalid types for multiply operation: boolean, bigint"`)
104102
})
105103

106104
test('dividing integer and float is ok', () => {

0 commit comments

Comments
 (0)