Skip to content

Commit 53b25af

Browse files
authored
Merge branch 'master' into progflow-fixes
2 parents d3bb8db + 4f66761 commit 53b25af

25 files changed

+98
-46
lines changed

ChangeLog.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
# Write Your Python Program - CHANGELOG
22

3+
* ? (?)
4+
* Fix bug with union of unions
5+
* 1.2.1 (2024-11-05)
6+
* Fix assets for visualization
7+
* 1.2.0 (2024-11-04)
8+
* Support for visualization
9+
* Fix handling of lazy annotations in records
10+
* Fix output of execution fails but some tests were successful
311
* 1.1.0 (2024-10-02)
412
* Improve invocation on windows, always use cmd.exe
513
* Fixed bugs #132, #133, #134, and #135

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"displayName": "Write Your Python Program!",
44
"description": "A user friendly python environment for beginners",
55
"license": "See license in LICENSE",
6-
"version": "1.1.0",
6+
"version": "1.2.1",
77
"publisher": "StefanWehr",
88
"icon": "icon.png",
99
"engines": {

python/deps/untypy/untypy/impl/union.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ def describe(self) -> str:
7171
def base_type(self) -> list[Any]:
7272
out = []
7373
for checker in self.inner:
74-
out.append(checker.base_type())
74+
out.extend(checker.base_type())
7575
return out
7676

7777

python/fileTests

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -287,6 +287,7 @@ checkWithOutputAux yes 0 test-data/testUnion3.py
287287
checkWithOutputAux yes 1 test-data/testLiteral1.py
288288
checkWithOutputAux yes 0 test-data/testForwardTypeInRecord.py
289289
checkWithOutputAux yes 0 test-data/testForwardTypeInRecord2.py
290+
checkWithOutputAux yes 0 test-data/testUnionOfUnion.py
290291

291292
function is_min_version()
292293
{

python/src/runner.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
from __future__ import annotations as anns
21
import sys
32
import os
43
import os.path
@@ -320,7 +319,7 @@ def runCode(fileToRun, globals, args, useUntypy=True, extraDirs=None):
320319

321320
with RunSetup(localDir):
322321
codeTxt = readFile(fileToRun)
323-
flags = 0 | anns.compiler_flag
322+
flags = 0
324323
if useUntypy:
325324
verbose(f'finding modules imported by {fileToRun}')
326325
importedMods = findImportedModules([localDir] + extraDirs, fileToRun)

python/test-data/fileWithRecursiveTypes.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
from __future__ import annotations
2+
13
class C:
24
def foo(self: C, d: D) -> C:
35
return C

python/test-data/testClassRecursion.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
from __future__ import annotations
12
from wypp import *
23

34
class C:
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
Traceback (most recent call last):
2-
File "test-data/testHintParentheses1.py", line 4, in <module>
2+
File "test-data/testHintParentheses1.py", line 5, in <module>
33
def foo(l: list(int)) -> int:
44
WyppAttributeError: Type annotation of function 'foo' could not be resolved:
55
'type' object is not iterable
66

77
def foo(l: list(int)) -> int:
88
return ^^^^^^^^^ - Did you mean: 'list[int]'?
99

10-
declared at: test-data/testHintParentheses1.py:4
10+
declared at: test-data/testHintParentheses1.py:5
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1+
from __future__ import annotations
12
from wypp import *
23
# See https://github.com/skogsbaer/write-your-python-program/issues/61
34

45
def foo(l: list(int)) -> int:
56
return len(l)
67

7-
check(foo([1,2,3]), 3)
8+
check(foo([1,2,3]), 3)
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
Traceback (most recent call last):
2-
File "test-data/testHintParentheses3.py", line 5, in <module>
2+
File "test-data/testHintParentheses3.py", line 6, in <module>
33
def foo() -> Union(list, str):
44
WyppAttributeError: Type annotation of function 'foo' could not be resolved:
55
Cannot call Union like a function. Did you mean Union[list, str]?
66

77
def foo() -> Union(list, str):
88
pass ^^^^^^^^^^^^^^^^ - Did you mean: 'Union[list, str]'?
99

10-
declared at: test-data/testHintParentheses3.py:5
10+
declared at: test-data/testHintParentheses3.py:6

0 commit comments

Comments
 (0)