Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 1e78770

Browse files
authored
Update reference.rst Language Limiations
Give @pyscript_compile and lambda as another work around for python callback functions.
1 parent 25c9b5a commit 1e78770

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

‎docs/reference.rst‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2146,7 +2146,8 @@ it doesn't faithfully mimic Python. Here are some areas where pyscript differs
21462146
won't be able to call that pyscript function unless it uses ``await``, which requires that function to
21472147
be declared ``async``. Unless the Python module is designed to support async callbacks, it is not
21482148
currently possible to have Python modules and packages call pyscript functions. The workaround is
2149-
to move your callbacks from pyscript and make them native Python functions; see `Importing <#importing>`__.
2149+
to move your callbacks from pyscript and make them native Python functions; see `Importing <#importing>`__,
2150+
call a function with the ``@pyscript_compile`` decorator, or a lambda (which is also compiled).
21502151
- Continuing that point, special methods (e.g., ``__eq__``) in a class created in `pyscript` will not work since
21512152
they are async functions and Python will not be able to call them. The two workarounds are to
21522153
use the ``@pyscript_compile`` decorator so the method is compiled to a native (non-async) Python

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /