diff --git a/docs/api.md b/docs/api.md index cec81455..6e4c71a1 100644 --- a/docs/api.md +++ b/docs/api.md @@ -56,8 +56,16 @@ from pyscript import config # It's just a dict. print(config.get("files")) +# This will be either "mpy" or "py" depending on the current interpreter. +print(config["type"]) ``` +!!! info + + The `config` object will always include a `type` attribute set to either + `mpy` or `py`, to indicate which version of Python your code is currently + running in. + !!! warning Changing the `config` dictionary at runtime has no effect on the actual diff --git a/docs/beginning-pyscript.md b/docs/beginning-pyscript.md index 998b53d0..f3799d46 100644 --- a/docs/beginning-pyscript.md +++ b/docs/beginning-pyscript.md @@ -117,8 +117,8 @@ module in the document's `` tag: 🦜 Polyglot - Piratical PyScript - - + + @@ -168,8 +168,8 @@ In the end, our HTML should look like this: 🦜 Polyglot - Piratical PyScript - - + +

Polyglot 🦜 💬 🇬🇧 ➡️ 🏴‍☠️

diff --git a/docs/user-guide/first-steps.md b/docs/user-guide/first-steps.md index d8a64448..871ec72a 100644 --- a/docs/user-guide/first-steps.md +++ b/docs/user-guide/first-steps.md @@ -20,9 +20,9 @@ CSS: - + - + diff --git a/docs/user-guide/plugins.md b/docs/user-guide/plugins.md index bf776c66..e0d05bdd 100644 --- a/docs/user-guide/plugins.md +++ b/docs/user-guide/plugins.md @@ -100,7 +100,7 @@ For example, this will work because all references are contained within the registered function: ```js -import { hooks } from "https://pyscript.net/releases/2024.9.1/core.js"; +import { hooks } from "https://pyscript.net/releases/2024.9.2/core.js"; hooks.worker.onReady.add(() => { // NOT suggested, just an example! @@ -114,7 +114,7 @@ hooks.worker.onReady.add(() => { However, due to the outer reference to the variable `i`, this will fail: ```js -import { hooks } from "https://pyscript.net/releases/2024.9.1/core.js"; +import { hooks } from "https://pyscript.net/releases/2024.9.2/core.js"; // NO NO NO NO NO! ☠️ let i = 0; @@ -147,7 +147,7 @@ the page. ```js title="log.js - a plugin that simply logs to the console." // import the hooks from PyScript first... -import { hooks } from "https://pyscript.net/releases/2024.9.1/core.js"; +import { hooks } from "https://pyscript.net/releases/2024.9.2/core.js"; // The `hooks.main` attribute defines plugins that run on the main thread. hooks.main.onReady.add((wrap, element) => { @@ -197,8 +197,8 @@ hooks.worker.onAfterRun.add(() => { - - + + + PyWorker - mpy bootstrapping pyodide example diff --git a/version.json b/version.json index f2ada48a..a0867dfc 100644 --- a/version.json +++ b/version.json @@ -1,3 +1,3 @@ { - "version": "2024.9.1" + "version": "2024.9.2" }