Files
RustPython/wasm/lib
fanninpm cc6baeddd6 Allow clippy::unnecessary_wraps lint, and rename "to_js" to "into_js" (#2452)
* Allow clippy::unnecessary_wraps lint

* Change PyResultExt to_js signature

* Change "to_js" to "into_js"

* Refactor "to_js" to "into_js"

* Continue refactoring "to_js" to "into_js"

* Move clippy::unnecessary_wraps to lib.rs

* Add allowed lint to jit/lib.rs

* Add allowed lint to vm/src/lib.rs
2021-02-13 19:07:07 -06:00
..
2021-01-20 12:56:30 -06:00
2021-01-25 20:04:32 -06:00

RustPython

A Python-3 (CPython >= 3.8.0) Interpreter written in Rust.

Build Status License: MIT Contributors Gitter

WARNING: this project is still in a pre-alpha state!

Using this in a production project is inadvisable. Please only do so if you understand the risks.

Usage

Check out our online demo running on WebAssembly.

Goals

  • Full Python-3 environment entirely in Rust (not CPython bindings)
  • A clean implementation without compatibility hacks

Quick Documentation

pyEval(code, options?);

code: string: The Python code to run

options:

  • vars?: { [key: string]: any }: Variables passed to the VM that can be accessed in Python with the variable js_vars. Functions do work, and receive the Python kwargs as the this argument.
  • stdout?: "console" | ((out: string) => void) | null: A function to replace the native print function, and it will be console.log when giving undefined or "console", and it will be a dumb function when giving null.

License

This project is licensed under the MIT license.