Re-export pyobject::* from the root of the crate

This commit is contained in:
Noah
2021-05-15 16:35:12 -05:00
parent 3f68a23963
commit 99104faaf7
133 changed files with 300 additions and 323 deletions

View File

@@ -1,10 +1,10 @@
use rustpython_vm as vm;
fn main() -> vm::pyobject::PyResult<()> {
fn main() -> vm::PyResult<()> {
vm::Interpreter::default().enter(run)
}
fn run(vm: &vm::VirtualMachine) -> vm::pyobject::PyResult<()> {
fn run(vm: &vm::VirtualMachine) -> vm::PyResult<()> {
let scope = vm.new_scope_with_builtins();
// the file parameter is relevant to the directory where the crate's Cargo.toml is located, see $CARGO_MANIFEST_DIR:

View File

@@ -1,6 +1,6 @@
use rustpython_vm as vm;
fn main() -> vm::pyobject::PyResult<()> {
fn main() -> vm::PyResult<()> {
vm::Interpreter::default().enter(|vm| {
let scope = vm.new_scope_with_builtins();

View File

@@ -7,7 +7,7 @@ use rustpython_vm as vm;
// these are needed for special memory shenanigans to let us share a variable with Python and Rust
use std::sync::atomic::{AtomicBool, Ordering};
// this needs to be in scope in order to insert things into scope.globals
use vm::pyobject::ItemProtocol;
use vm::ItemProtocol;
// This has to be a macro because it uses the py_compile macro,
// which compiles python source to optimized bytecode at compile time, so that
@@ -30,11 +30,11 @@ fn on(b: bool) {
ON.store(b, Ordering::Relaxed);
}
fn main() -> vm::pyobject::PyResult<()> {
fn main() -> vm::PyResult<()> {
vm::Interpreter::default().enter(run)
}
fn run(vm: &vm::VirtualMachine) -> vm::pyobject::PyResult<()> {
fn run(vm: &vm::VirtualMachine) -> vm::PyResult<()> {
let mut input = String::with_capacity(50);
let stdin = std::io::stdin();