Skip to content

Commit 04bd867

Browse files
committed
minor doc edits
1 parent 13354a8 commit 04bd867

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

docs/reference.rst

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1177,7 +1177,7 @@ occurs.
11771177
``task.cancel(task_id=None)``
11781178
Cancels (kills) the task specified by the ``task_id`` returned by ``task.create``. This is a
11791179
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
11811181
to use in a trigger function on error, instead of a `return` or raising an exception.
11821182

11831183
``task.current_task()``
@@ -2025,7 +2025,7 @@ Here are some areas where pyscript differs from real Python:
20252025
be declared ``async``. Unless the Python module is designed to support async callbacks, it is not
20262026
currently possible to have Python modules and packages call pyscript functions. The workaround is
20272027
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
20292029
they are async functions and Python will not be able to call them. The two workarounds are to
20302030
use the ``@pyscript_compile`` decorator so the method is compiled to a native (non-ascync) Python
20312031
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:
20442044
A handful of language features are not supported:
20452045

20462046
- generators and the ``yield`` statement; these are difficult to implement in an interpreter.
2047+
- the ``match-case`` statement is not supported.
20472048
- built-in functions that do I/O, such as ``open``, ``read`` and ``write`` are not supported to avoid
20482049
I/O in the main event loop, and also to avoid security issues if people share pyscripts. The ``print``
20492050
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:
20552056
Pyscript can call Python modules and packages, so you can always write your own native Python code
20562057
(eg, if you need a generator or other unsupported feature) that can be called by pyscript
20572058
(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

Comments
 (0)