| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 9be1dc1 commit 625f867
68 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -51,8 +51,8 @@ use rustpython_vm::{ | |||
| 51 | 51 | compile, match_class, | |
| 52 | 52 | scope::Scope, | |
| 53 | 53 | stdlib::{atexit, sys}, | |
| 54 | - InitParameter, Interpreter, PyObjectRef, PyResult, PySettings, TryFromObject, TypeProtocol, | ||
| 55 | - VirtualMachine, | ||
| 54 | + AsPyObject, InitParameter, Interpreter, PyObjectRef, PyResult, PySettings, TryFromObject, | ||
| 55 | + TypeProtocol, VirtualMachine, | ||
| 56 | 56 | }; | |
| 57 | 57 | use std::{env, path::Path, process, str::FromStr}; | |
| 58 | 58 | ||
@@ -536,12 +536,8 @@ fn setup_main_module(vm: &VirtualMachine) -> PyResult<Scope> { | |||
| 536 | 536 | main_module | |
| 537 | 537 | .dict() | |
| 538 | 538 | .and_then(|d| { | |
| 539 | - d.set_item( | ||
| 540 | - "__annotations__", | ||
| 541 | - vm.ctx.new_dict().as_object().to_owned(), | ||
| 542 | - vm, | ||
| 543 | - ) | ||
| 544 | - .ok() | ||
| 539 | + d.set_item("__annotations__", vm.ctx.new_dict().into(), vm) | ||
| 540 | + .ok() | ||
| 545 | 541 | }) | |
| 546 | 542 | .expect("Failed to initialize __main__.__annotations__"); | |
| 547 | 543 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -85,9 +85,8 @@ impl<'vm> ShellHelper<'vm> { | |||
| 85 | 85 | } else { | |
| 86 | 86 | // we need to get a variable based off of globals/builtins | |
| 87 | 87 | ||
| 88 | - let globals = str_iter_method(self.globals.as_object().to_owned(), "keys").ok()?; | ||
| 89 | - let builtins = | ||
| 90 | - str_iter_method(self.vm.builtins.as_object().to_owned(), "__dir__").ok()?; | ||
| 88 | + let globals = str_iter_method(self.globals.clone().into(), "keys").ok()?; | ||
| 89 | + let builtins = str_iter_method(self.vm.builtins.clone().into(), "__dir__").ok()?; | ||
| 91 | 90 | (first, globals, Some(builtins)) | |
| 92 | 91 | }; | |
| 93 | 92 | Some((word_start, iter1.chain(iter2.into_iter().flatten()))) | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -33,14 +33,13 @@ mod array { | |||
| 33 | 33 | AsBuffer, AsMapping, Comparable, Constructor, IterNext, IterNextIterable, Iterable, | |
| 34 | 34 | PyComparisonOp, | |
| 35 | 35 | }, | |
| 36 | - IdProtocol, PyObject, PyObjectRef, PyObjectView, PyObjectWrap, PyRef, PyResult, | ||
| 37 | - PyValue, TryFromBorrowedObject, TryFromObject, TypeProtocol, VirtualMachine, | ||
| 36 | + AsPyObject, PyObject, PyObjectRef, PyObjectView, PyRef, PyResult, PyValue, | ||
| 37 | + TryFromBorrowedObject, TryFromObject, TypeProtocol, VirtualMachine, | ||
| 38 | 38 | }, | |
| 39 | 39 | }; | |
| 40 | 40 | use itertools::Itertools; | |
| 41 | 41 | use num_traits::ToPrimitive; | |
| 42 | - use std::cmp::Ordering; | ||
| 43 | - use std::{fmt, os::raw}; | ||
| 42 | + use std::{cmp::Ordering, fmt, os::raw}; | ||
| 44 | 43 | ||
| 45 | 44 | macro_rules! def_array_enum { | |
| 46 | 45 | ($(($n:ident, $t:ty, $c:literal, $scode:literal)),*$(,)?) => { | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -9,7 +9,7 @@ mod _json { | |||
| 9 | 9 | function::{IntoPyObject, IntoPyResult, OptionalArg}, | |
| 10 | 10 | protocol::PyIterReturn, | |
| 11 | 11 | types::{Callable, Constructor}, | |
| 12 | - IdProtocol, PyObjectRef, PyObjectView, PyResult, PyValue, VirtualMachine, | ||
| 12 | + AsPyObject, PyObjectRef, PyObjectView, PyResult, PyValue, VirtualMachine, | ||
| 13 | 13 | }; | |
| 14 | 14 | use num_bigint::BigInt; | |
| 15 | 15 | use std::str::FromStr; | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -7,7 +7,7 @@ use crate::{ | |||
| 7 | 7 | protocol::PyIterReturn, | |
| 8 | 8 | pyclass::PyClassImpl, | |
| 9 | 9 | types::{Constructor, IterNext, IterNextIterable, Unconstructible}, | |
| 10 | - IdProtocol, PyContext, PyObjectRef, PyRef, PyResult, PyValue, TypeProtocol, VirtualMachine, | ||
| 10 | + AsPyObject, PyContext, PyObjectRef, PyRef, PyResult, PyValue, TypeProtocol, VirtualMachine, | ||
| 11 | 11 | }; | |
| 12 | 12 | ||
| 13 | 13 | use crossbeam_utils::atomic::AtomicCell; | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -33,7 +33,7 @@ use crate::{ | |||
| 33 | 33 | IterNextIterable, Iterable, PyComparisonOp, Unconstructible, Unhashable, | |
| 34 | 34 | }, | |
| 35 | 35 | utils::Either, | |
| 36 | - IdProtocol, PyContext, PyObject, PyObjectRef, PyObjectView, PyObjectWrap, PyRef, PyResult, | ||
| 36 | + AsPyObject, PyContext, PyObject, PyObjectRef, PyObjectView, PyObjectWrap, PyRef, PyResult, | ||
| 37 | 37 | PyValue, TryFromBorrowedObject, TryFromObject, TypeProtocol, VirtualMachine, | |
| 38 | 38 | }; | |
| 39 | 39 | use bstr::ByteSlice; | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -22,7 +22,7 @@ use crate::{ | |||
| 22 | 22 | IterNextIterable, Iterable, PyComparisonOp, Unconstructible, | |
| 23 | 23 | }, | |
| 24 | 24 | utils::Either, | |
| 25 | - IdProtocol, PyContext, PyObject, PyObjectRef, PyObjectView, PyObjectWrap, PyRef, PyResult, | ||
| 25 | + AsPyObject, PyContext, PyObject, PyObjectRef, PyObjectView, PyObjectWrap, PyRef, PyResult, | ||
| 26 | 26 | PyValue, TryFromBorrowedObject, TryFromObject, TypeProtocol, VirtualMachine, | |
| 27 | 27 | }; | |
| 28 | 28 | use bstr::ByteSlice; | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -7,7 +7,7 @@ use crate::{ | |||
| 7 | 7 | bytecode::{self, BorrowedConstant, Constant, ConstantBag}, | |
| 8 | 8 | function::FuncArgs, | |
| 9 | 9 | pyclass::{PyClassImpl, StaticType}, | |
| 10 | - IdProtocol, PyContext, PyObject, PyObjectRef, PyRef, PyResult, PyValue, TypeProtocol, | ||
| 10 | + AsPyObject, PyContext, PyObject, PyObjectRef, PyRef, PyResult, PyValue, TypeProtocol, | ||
| 11 | 11 | VirtualMachine, | |
| 12 | 12 | }; | |
| 13 | 13 | use num_traits::Zero; | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -7,7 +7,7 @@ use crate::{ | |||
| 7 | 7 | }, | |
| 8 | 8 | pyclass::PyClassImpl, | |
| 9 | 9 | types::{Comparable, Constructor, Hashable, PyComparisonOp}, | |
| 10 | - IdProtocol, PyContext, PyObject, PyObjectRef, PyRef, PyResult, PyValue, TypeProtocol, | ||
| 10 | + AsPyObject, PyContext, PyObject, PyObjectRef, PyRef, PyResult, PyValue, TypeProtocol, | ||
| 11 | 11 | VirtualMachine, | |
| 12 | 12 | }; | |
| 13 | 13 | use num_complex::Complex64; | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -6,7 +6,7 @@ use crate::{ | |||
| 6 | 6 | protocol::PyIterReturn, | |
| 7 | 7 | pyclass::PyClassImpl, | |
| 8 | 8 | types::{Constructor, IterNext, IterNextIterable, Unconstructible}, | |
| 9 | - IdProtocol, PyContext, PyObjectRef, PyRef, PyResult, PyValue, VirtualMachine, | ||
| 9 | + AsPyObject, PyContext, PyObjectRef, PyRef, PyResult, PyValue, VirtualMachine, | ||
| 10 | 10 | }; | |
| 11 | 11 | ||
| 12 | 12 | #[pyclass(module = false, name = "coroutine")] | |
| Back | FazBrowse Home | New Git URL |
0 commit comments