You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+10-35Lines changed: 10 additions & 35 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -37,6 +37,11 @@ Run `wypp --help` for usage information.
37
37
38
38
Here is the [Changelog](ChangeLog.md).
39
39
40
+
***Breaking change** in version 2.0.0 (2025-0-24): type annotations are now only
41
+
checked when entering/exiting a function. Before, certain things such as lists
42
+
or callable were put behind wrapper objects. For example, these wrappers ensured
43
+
that only ints could be appended to a list of type `list[int]`. However, these
44
+
wrappers came with several drawbacks, so they were removed in release 2.0.0
40
45
***Breaking change** in version 0.12.0 (2021-09-28): type annotations are now checked
41
46
dynamically when the code is executed.
42
47
This behavior can be deactivated in the settings of the extension.
@@ -47,7 +52,10 @@ You need an explicit import statement such as `from wypp import *`.
47
52
48
53
Here is a screen shot:
49
54
50
-

55
+

56
+
57
+
There is also a visualization mode, similar to [Python Tutor](https://pythontutor.com/):
58
+

51
59
52
60
When hitting the RUN button, the vscode extension saves the current file, opens
53
61
a terminal and executes the file with Python, staying in interactive mode after
@@ -56,7 +64,7 @@ all definitions have been executed.
56
64
The file being executed should contain the following import statement in the first line:
57
65
58
66
~~~python
59
-
from wypp import*
67
+
from wypp import*
60
68
~~~
61
69
62
70
Running the file with the RUN button makes the following features available:
@@ -190,39 +198,6 @@ before the type being defined, for example to define recursive types or as
190
198
the type of `self` inside of classes. In fact, there is no check at all to make sure
191
199
that anotations refer to existing types.
192
200
193
-
For builtin `list[T]` the following operations are typechecked:
194
-
-`list[idx]`
195
-
-`list[idx] = value`
196
-
-`list += [...]`
197
-
-`list.append(value)`
198
-
-`list.insert(idx, value)`
199
-
-`list.extend(iterator)`
200
-
-`for i in list:` (Iterator)
201
-
202
-
For builtin `set[T]` these operations are typechecked:
203
-
-`set.add(value)`
204
-
-`set.pop()`
205
-
-`set.remove(value)` Value must be of `T`
206
-
-`set.update(other, ...)`
207
-
-`value in set` Value must be of `T`
208
-
-`for i in set:` (Iterator)
209
-
210
-
For builtin `dict[K,V]` the supported typechecked operations are:
211
-
-`dict.get(key)`
212
-
-`dict.items()`
213
-
-`dict.keys()`
214
-
-`dict.pop()`
215
-
-`dict.popitem()`
216
-
-`dict.setdefault(key, default)` <br/>_Note:_ In contrast to the standard library `default` is required, to avoid inserting `None` as value into otherwise typed dicts.
0 commit comments