@@ -1177,7 +1177,7 @@ occurs.
1177
1177
``task.cancel(task_id=None) ``
1178
1178
Cancels (kills) the task specified by the ``task_id `` returned by ``task.create ``. This is a
1179
1179
simpler alternative to the ``task_id.cancel() `` method, which also requires waiting for the
1180
- task to cancel. With no argument, `task.cancel ` cancels the current task, which you might prefer
1180
+ task to cancel. With no argument, `` task.cancel ` ` cancels the current task, which you might prefer
1181
1181
to use in a trigger function on error, instead of a `return ` or raising an exception.
1182
1182
1183
1183
``task.current_task() ``
@@ -2025,7 +2025,7 @@ Here are some areas where pyscript differs from real Python:
2025
2025
be declared ``async ``. Unless the Python module is designed to support async callbacks, it is not
2026
2026
currently possible to have Python modules and packages call pyscript functions. The workaround is
2027
2027
to move your callbacks from pyscript and make them native Python functions; see `Importing <#importing >`__.
2028
- - Continuing that point, special methods (eg, `__eq__ `) in a class created in `pyscript ` will not work since
2028
+ - Continuing that point, special methods (eg, `` __eq__ ` `) in a class created in `pyscript ` will not work since
2029
2029
they are async functions and Python will not be able to call them. The two workarounds are to
2030
2030
use the ``@pyscript_compile `` decorator so the method is compiled to a native (non-ascync) Python
2031
2031
function, or write your class in native Python and import it into ``pyscript ``; see `Importing <#importing >`__.
@@ -2044,6 +2044,7 @@ Here are some areas where pyscript differs from real Python:
2044
2044
A handful of language features are not supported:
2045
2045
2046
2046
- generators and the ``yield `` statement; these are difficult to implement in an interpreter.
2047
+ - the ``match-case `` statement is not supported.
2047
2048
- built-in functions that do I/O, such as ``open ``, ``read `` and ``write `` are not supported to avoid
2048
2049
I/O in the main event loop, and also to avoid security issues if people share pyscripts. The ``print ``
2049
2050
function only logs a message, rather than implements the real ``print `` features, such as specifying
@@ -2055,3 +2056,5 @@ A handful of language features are not supported:
2055
2056
Pyscript can call Python modules and packages, so you can always write your own native Python code
2056
2057
(eg, if you need a generator or other unsupported feature) that can be called by pyscript
2057
2058
(see `Importing <#importing >`__ for how to create and import native Python modules in pyscript).
2059
+ You can also include native Python functions in your pyscript code by using the ``@pyscript_compile ``
2060
+ decorator.
0 commit comments