Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 4 additions & 15 deletions docs/faq.md
Original file line number Diff line number Diff line change
Expand Up @@ -517,7 +517,7 @@ poor introspection capabilities:
* Making use of the capitalized-name-for-classes convention is brittle because
when JavaScript code is minified the class name can sometimes change.
* This leaves our convention of `Class.new()` to explicitly signal the intent
to instantiate a JavaScript class. While not idea it is clear and
to instantiate a JavaScript class. While not ideal it is clear and
unambiguous.

### PyScript events
Expand Down Expand Up @@ -838,11 +838,6 @@ def download_file(path, mime_type):
# should keep the memory clear for the session
```

!!! warning

This currently only works with Pyodide due to a bug instantiating
`window.File` in MicroPython.

### create_proxy

The `create_proxy` function is described in great detail
Expand Down Expand Up @@ -1148,15 +1143,9 @@ you're using Pyodide or MicroPython as your interpreter.
**When using `pyscript.to_js`, the result is detached from the original
Python dictionary.**

Any change to the JavaScript object **will not be reflected in the original
Python object**. For the vast majority of use cases, this is a desirable
trade-off. But it's important to note this detachment.

The ability for a `Map` to remain attached to the related Python `dict` is
perhaps an important reason Pyodide chose this implementation detail.
Therefore, if you have JavaScript code that requires changes of state to be
reflected in the Python world you should use the underlying `pyodide.ffi.to_js`
API.
Any change to the JavaScript object **will not be reflected in the original
Python object**. For the vast majority of use cases, this is a desirable
trade-off. But it's important to note this detachment.

If you're simply passing data around, `pyscript.ffi.to_js` will fulfil your
requirements in a simple and idiomatic manner.
5 changes: 3 additions & 2 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,14 @@
<a href="beginning-pyscript">beginning PyScript guide</a>
and then using
<a href="https://pyscript.com/" target="_blank">pyscript.com</a>
to create your first apps.</dd>
to create your first apps. Having problems? Check out our
<a href="faq">frequently asked questions</a>.</dd>
<dt><strong>I'm already technical...</strong></dt>
<dd>The beginner docs will set you up with a simple coding environment. For
more in-depth technical coverage of PyScript, consult the
<a href="user-guide">user guide</a>. The
<a href="examples">example applications</a> demonstrate many of the features
of PyScript.</dd>
of PyScript. The <a href="faq">FAQ</a> contains lots of technical detail.</dd>
<dt><strong>I want to contribute...</strong></dt>
<dd>
<p>Welcome, friend!
Expand Down
2 changes: 1 addition & 1 deletion docs/user-guide/workers.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ attribute flag:
```

Alternatively, to launch a worker from within Python running on the main thread
use the [pyscript.PyWorker](../builtins/#pyscriptpyworker) class and must
use the [pyscript.PyWorker](../builtins/#pyscriptpyworker) class and you must
reference both the target Python script and interpreter type:

```python title="Launch a worker from within Python"
Expand Down