waspy 0.9.0

A Python interpreter written in Rust, designed for WebAssembly.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
use crate::stdlib::StdlibValue;

pub fn get_attribute(attr: &str) -> Option<StdlibValue> {
    match attr {
        "argv" => Some(StdlibValue::List(vec![])),
        "platform" => Some(StdlibValue::String("wasm32".to_string())),
        "version" => Some(StdlibValue::String("3.11.0 (waspy)".to_string())),
        "maxsize" => Some(StdlibValue::Int(i32::MAX)),
        "stdin" | "stdout" | "stderr" => Some(StdlibValue::None),
        "path" => Some(StdlibValue::List(vec![])),
        _ => None,
    }
}