Wikifunctions:Python implementations
Appearance
See also: WF:JS
You can do most things that work in Rustpython which is used under the hood.
- "RustPython is in development, and while the interpreter certainly can be used in interesting use cases like running Python in WASM and embedding into a Rust project, do note that RustPython is not totally production-ready." Source.
See https://rustpython.github.io/pages/whats-left for an overview of missing built-in modules.
Error handling
Open questions as of October 2024
- How to cast a string to a Wikidata item reference (Z6091)? (raised in telegram)
Known limitations as of October 2024
Modules
Only built-in python modules in RustPython is supported (installation of modules is not supported)
This is by design to avoid reproducibility issues and bugs caused by different module versions.
HTTP connections
Disabled by design for security and reproducibility reasons.
- the built-in module http.client does not work. Because of that it is currently not possible to make ANY HTTP requests from implementations. See https://phabricator.wikimedia.org/T371484
Matrices (lists of lists)
Functions which return a list of lists can't be implemented in Python, they will fail with a Z500 Could not serialize input Python object
error.
