mirror of
https://github.com/RustPython/RustPython.git
synced 2026-10-29 03:04:38 +08:00
AsPyObject -> AsObject because fn as_object
This commit is contained in:
1 parent
6121195548
commit
fee3bf2722
96 files changed
+110
-111
No files matched your search
+1
-1
@@ -51,7 +51,7 @@ use rustpython_vm::{
|
||||
compile, match_class,
|
||||
scope::Scope,
|
||||
stdlib::{atexit, sys},
|
||||
AsPyObject, InitParameter, Interpreter, PyObjectRef, PyResult, PySettings, TryFromObject,
|
||||
AsObject, InitParameter, Interpreter, PyObjectRef, PyResult, PySettings, TryFromObject,
|
||||
VirtualMachine,
|
||||
};
|
||||
use std::{env, path::Path, process, str::FromStr};
|
||||
|
||||
+1
-1
@@ -6,7 +6,7 @@ use rustpython_vm::{
|
||||
builtins::PyBaseExceptionRef,
|
||||
compile::{self, CompileError, CompileErrorType},
|
||||
scope::Scope,
|
||||
AsPyObject, PyResult, VirtualMachine,
|
||||
AsObject, PyResult, VirtualMachine,
|
||||
};
|
||||
|
||||
enum ShellExecResult {
|
||||
|
||||
+1
-1
@@ -31,7 +31,7 @@ mod array {
|
||||
AsBuffer, AsMapping, Comparable, Constructor, IterNext, IterNextIterable, Iterable,
|
||||
PyComparisonOp,
|
||||
},
|
||||
AsPyObject, PyObject, PyObjectRef, PyObjectView, PyRef, PyResult, PyValue,
|
||||
AsObject, PyObject, PyObjectRef, PyObjectView, PyRef, PyResult, PyValue,
|
||||
VirtualMachine,
|
||||
},
|
||||
};
|
||||
|
||||
+1
-1
@@ -16,7 +16,7 @@ mod _csv {
|
||||
match_class,
|
||||
protocol::{PyIter, PyIterReturn},
|
||||
types::{IterNext, IterNextIterable},
|
||||
AsPyObject, PyObjectRef, PyObjectView, PyResult, PyValue, TryFromObject, VirtualMachine,
|
||||
AsObject, PyObjectRef, PyObjectView, PyResult, PyValue, TryFromObject, VirtualMachine,
|
||||
};
|
||||
use itertools::{self, Itertools};
|
||||
use std::fmt;
|
||||
|
||||
+1
-1
@@ -10,7 +10,7 @@ mod _json {
|
||||
function::OptionalArg,
|
||||
protocol::PyIterReturn,
|
||||
types::{Callable, Constructor},
|
||||
AsPyObject, PyObjectRef, PyObjectView, PyResult, PyValue, VirtualMachine,
|
||||
AsObject, PyObjectRef, PyObjectView, PyResult, PyValue, VirtualMachine,
|
||||
};
|
||||
use num_bigint::BigInt;
|
||||
use std::str::FromStr;
|
||||
|
||||
+1
-1
@@ -6,7 +6,7 @@ mod math {
|
||||
builtins::{try_bigint_to_f64, try_f64_to_bigint, PyFloat, PyInt, PyIntRef},
|
||||
function::{ArgIntoFloat, ArgIterable, OptionalArg, PosArgs},
|
||||
utils::Either,
|
||||
AsPyObject, PyObject, PyObjectRef, PyRef, PyResult, VirtualMachine,
|
||||
AsObject, PyObject, PyObjectRef, PyRef, PyResult, VirtualMachine,
|
||||
};
|
||||
use num_bigint::BigInt;
|
||||
use num_traits::{One, Signed, Zero};
|
||||
|
||||
@@ -16,7 +16,7 @@ pub(crate) mod _struct {
|
||||
match_class,
|
||||
protocol::PyIterReturn,
|
||||
types::{Constructor, IterNext, IterNextIterable},
|
||||
AsPyObject, PyObjectRef, PyObjectView, PyResult, PyValue, TryFromObject, VirtualMachine,
|
||||
AsObject, PyObjectRef, PyObjectView, PyResult, PyValue, TryFromObject, VirtualMachine,
|
||||
};
|
||||
use crossbeam_utils::atomic::AtomicCell;
|
||||
|
||||
|
||||
@@ -261,7 +261,7 @@ mod decl {
|
||||
use super::*;
|
||||
use crate::vm::{
|
||||
builtins::PyFloat, common::lock::PyMutex, convert::ToPyObject, function::OptionalArg,
|
||||
stdlib::io::Fildes, AsPyObject, PyValue,
|
||||
stdlib::io::Fildes, AsObject, PyValue,
|
||||
};
|
||||
use libc::pollfd;
|
||||
use num_traits::ToPrimitive;
|
||||
|
||||
@@ -16,7 +16,7 @@ mod _socket {
|
||||
convert::{ToPyException, ToPyObject, TryFromBorrowedObject, TryFromObject},
|
||||
function::{ArgBytesLike, ArgMemoryBuffer, FuncArgs, OptionalArg, OptionalOption},
|
||||
utils::{Either, ToCString},
|
||||
AsPyObject, PyObjectRef, PyResult, PyValue, VirtualMachine,
|
||||
AsObject, PyObjectRef, PyResult, PyValue, VirtualMachine,
|
||||
};
|
||||
use crossbeam_utils::atomic::AtomicCell;
|
||||
use num_traits::ToPrimitive;
|
||||
|
||||
+1
-1
@@ -3,7 +3,7 @@ use crate::{
|
||||
cformat::CFormatString,
|
||||
function::{single_or_tuple_any, OptionalOption},
|
||||
protocol::PyIterIter,
|
||||
AsPyObject, PyObjectRef, PyResult, TryFromObject, VirtualMachine,
|
||||
AsObject, PyObjectRef, PyResult, TryFromObject, VirtualMachine,
|
||||
};
|
||||
use num_traits::{cast::ToPrimitive, sign::Signed};
|
||||
use std::str::FromStr;
|
||||
|
||||
@@ -7,7 +7,7 @@ use crate::{
|
||||
protocol::PyIterReturn,
|
||||
pyclass::PyClassImpl,
|
||||
types::{Constructor, IterNext, IterNextIterable, Unconstructible},
|
||||
AsPyObject, PyContext, PyObjectRef, PyRef, PyResult, PyValue, VirtualMachine,
|
||||
AsObject, PyContext, PyObjectRef, PyRef, PyResult, PyValue, VirtualMachine,
|
||||
};
|
||||
|
||||
use crossbeam_utils::atomic::AtomicCell;
|
||||
|
||||
@@ -4,7 +4,7 @@ use crate::{
|
||||
function::{FuncArgs, IntoPyNativeFunc, PyNativeFunc},
|
||||
pyclass::PyClassImpl,
|
||||
types::{Callable, Constructor, GetDescriptor, Unconstructible},
|
||||
AsPyObject, PyContext, PyObjectRef, PyRef, PyResult, PyValue, VirtualMachine,
|
||||
AsObject, PyContext, PyObjectRef, PyRef, PyResult, PyValue, VirtualMachine,
|
||||
};
|
||||
use std::fmt;
|
||||
|
||||
|
||||
@@ -33,7 +33,7 @@ use crate::{
|
||||
IterNextIterable, Iterable, PyComparisonOp, Unconstructible, Unhashable,
|
||||
},
|
||||
utils::Either,
|
||||
AsPyObject, PyContext, PyObject, PyObjectRef, PyObjectView, PyObjectWrap, PyRef, PyResult,
|
||||
AsObject, PyContext, PyObject, PyObjectRef, PyObjectView, PyObjectWrap, PyRef, PyResult,
|
||||
PyValue, TryFromBorrowedObject, TryFromObject, VirtualMachine,
|
||||
};
|
||||
use bstr::ByteSlice;
|
||||
|
||||
@@ -20,7 +20,7 @@ use crate::{
|
||||
IterNextIterable, Iterable, PyComparisonOp, Unconstructible,
|
||||
},
|
||||
utils::Either,
|
||||
AsPyObject, PyContext, PyObject, PyObjectRef, PyObjectView, PyObjectWrap, PyRef, PyResult,
|
||||
AsObject, PyContext, PyObject, PyObjectRef, PyObjectView, PyObjectWrap, PyRef, PyResult,
|
||||
PyValue, TryFromBorrowedObject, TryFromObject, VirtualMachine,
|
||||
};
|
||||
use bstr::ByteSlice;
|
||||
|
||||
@@ -3,7 +3,7 @@ use crate::{
|
||||
builtins::PyBoundMethod,
|
||||
pyclass::PyClassImpl,
|
||||
types::{Constructor, GetDescriptor},
|
||||
AsPyObject, PyContext, PyObjectRef, PyRef, PyResult, PyValue, VirtualMachine,
|
||||
AsObject, PyContext, PyObjectRef, PyRef, PyResult, PyValue, VirtualMachine,
|
||||
};
|
||||
|
||||
/// classmethod(function) -> method
|
||||
|
||||
@@ -7,7 +7,7 @@ use crate::{
|
||||
bytecode::{self, BorrowedConstant, Constant, ConstantBag},
|
||||
function::FuncArgs,
|
||||
pyclass::{PyClassImpl, StaticType},
|
||||
AsPyObject, PyContext, PyObject, PyObjectRef, PyRef, PyResult, PyValue, VirtualMachine,
|
||||
AsObject, PyContext, PyObject, PyObjectRef, PyRef, PyResult, PyValue, VirtualMachine,
|
||||
};
|
||||
use num_traits::Zero;
|
||||
use std::{fmt, ops::Deref};
|
||||
|
||||
@@ -8,7 +8,7 @@ use crate::{
|
||||
},
|
||||
pyclass::PyClassImpl,
|
||||
types::{Comparable, Constructor, Hashable, PyComparisonOp},
|
||||
AsPyObject, PyContext, PyObject, PyObjectRef, PyRef, PyResult, PyValue, VirtualMachine,
|
||||
AsObject, PyContext, PyObject, PyObjectRef, PyRef, PyResult, PyValue, VirtualMachine,
|
||||
};
|
||||
use num_complex::Complex64;
|
||||
use num_traits::Zero;
|
||||
|
||||
@@ -6,7 +6,7 @@ use crate::{
|
||||
protocol::PyIterReturn,
|
||||
pyclass::PyClassImpl,
|
||||
types::{Constructor, IterNext, IterNextIterable, Unconstructible},
|
||||
AsPyObject, PyContext, PyObjectRef, PyRef, PyResult, PyValue, VirtualMachine,
|
||||
AsObject, PyContext, PyObjectRef, PyRef, PyResult, PyValue, VirtualMachine,
|
||||
};
|
||||
|
||||
#[pyclass(module = false, name = "coroutine")]
|
||||
|
||||
@@ -21,7 +21,7 @@ use crate::{
|
||||
IterNextIterable, Iterable, PyComparisonOp, Unconstructible, Unhashable,
|
||||
},
|
||||
vm::{ReprGuard, VirtualMachine},
|
||||
AsPyObject, PyContext, PyObject, PyObjectRef, PyObjectView, PyRef, PyResult, PyValue,
|
||||
AsObject, PyContext, PyObject, PyObjectRef, PyObjectView, PyRef, PyResult, PyValue,
|
||||
TryFromObject,
|
||||
};
|
||||
use rustpython_common::lock::PyMutex;
|
||||
|
||||
@@ -6,7 +6,7 @@ use crate::{
|
||||
protocol::{PyIter, PyIterReturn},
|
||||
pyclass::PyClassImpl,
|
||||
types::{Constructor, IterNext, IterNextIterable},
|
||||
AsPyObject, PyContext, PyObjectRef, PyRef, PyResult, PyValue, VirtualMachine,
|
||||
AsObject, PyContext, PyObjectRef, PyRef, PyResult, PyValue, VirtualMachine,
|
||||
};
|
||||
use num_bigint::BigInt;
|
||||
use num_traits::Zero;
|
||||
|
||||
@@ -10,7 +10,7 @@ use crate::{
|
||||
},
|
||||
pyclass::PyClassImpl,
|
||||
types::{Comparable, Constructor, Hashable, PyComparisonOp},
|
||||
AsPyObject, PyContext, PyObject, PyObjectRef, PyRef, PyResult, PyValue, TryFromBorrowedObject,
|
||||
AsObject, PyContext, PyObject, PyObjectRef, PyRef, PyResult, PyValue, TryFromBorrowedObject,
|
||||
TryFromObject, VirtualMachine,
|
||||
};
|
||||
use num_bigint::{BigInt, ToBigInt};
|
||||
|
||||
@@ -7,7 +7,7 @@ use crate::{
|
||||
frame::{Frame, FrameRef},
|
||||
pyclass::PyClassImpl,
|
||||
types::{Constructor, Unconstructible},
|
||||
AsPyObject, PyContext, PyObjectRef, PyObjectWrap, PyRef, PyResult, VirtualMachine,
|
||||
AsObject, PyContext, PyObjectRef, PyObjectWrap, PyRef, PyResult, VirtualMachine,
|
||||
};
|
||||
|
||||
pub fn init(context: &PyContext) {
|
||||
|
||||
@@ -14,7 +14,7 @@ use crate::{
|
||||
pyclass::PyClassImpl,
|
||||
scope::Scope,
|
||||
types::{Callable, Comparable, Constructor, GetAttr, GetDescriptor, PyComparisonOp},
|
||||
AsPyObject, PyContext, PyObject, PyObjectRef, PyRef, PyResult, PyValue, VirtualMachine,
|
||||
AsObject, PyContext, PyObject, PyObjectRef, PyRef, PyResult, PyValue, VirtualMachine,
|
||||
};
|
||||
#[cfg(feature = "jit")]
|
||||
use crate::{common::lock::OnceCell, convert::ToPyObject};
|
||||
|
||||
@@ -3,7 +3,7 @@ use crate::{
|
||||
bytecode::CodeFlags,
|
||||
convert::ToPyObject,
|
||||
function::FuncArgs,
|
||||
AsPyObject, PyObject, PyObjectRef, PyResult, TryFromObject, VirtualMachine,
|
||||
AsObject, PyObject, PyObjectRef, PyResult, TryFromObject, VirtualMachine,
|
||||
};
|
||||
use num_traits::ToPrimitive;
|
||||
use rustpython_jit::{AbiValue, Args, CompiledCode, JitArgumentError, JitType};
|
||||
|
||||
@@ -10,7 +10,7 @@ use crate::{
|
||||
protocol::PyIterReturn,
|
||||
pyclass::PyClassImpl,
|
||||
types::{Constructor, IterNext, IterNextIterable, Unconstructible},
|
||||
AsPyObject, PyContext, PyObjectRef, PyRef, PyResult, PyValue, VirtualMachine,
|
||||
AsObject, PyContext, PyObjectRef, PyRef, PyResult, PyValue, VirtualMachine,
|
||||
};
|
||||
|
||||
#[pyclass(module = false, name = "generator")]
|
||||
|
||||
@@ -6,7 +6,7 @@ use crate::{
|
||||
protocol::PyMappingMethods,
|
||||
pyclass::PyClassImpl,
|
||||
types::{AsMapping, Callable, Comparable, Constructor, GetAttr, Hashable, PyComparisonOp},
|
||||
AsPyObject, PyContext, PyObject, PyObjectRef, PyObjectView, PyRef, PyResult, PyValue,
|
||||
AsObject, PyContext, PyObject, PyObjectRef, PyObjectView, PyRef, PyResult, PyValue,
|
||||
TryFromObject, VirtualMachine,
|
||||
};
|
||||
use std::fmt;
|
||||
|
||||
@@ -8,7 +8,7 @@ use crate::{
|
||||
pyclass::PyClassImpl,
|
||||
pyobject::PyThreadingConstraint,
|
||||
types::{Constructor, GetDescriptor, Unconstructible},
|
||||
AsPyObject, PyContext, PyObjectRef, PyRef, PyResult, PyValue, TryFromObject, VirtualMachine,
|
||||
AsObject, PyContext, PyObjectRef, PyRef, PyResult, PyValue, TryFromObject, VirtualMachine,
|
||||
};
|
||||
|
||||
pub type PyGetterFunc = Box<py_dyn_fn!(dyn Fn(&VirtualMachine, PyObjectRef) -> PyResult)>;
|
||||
|
||||
@@ -7,7 +7,7 @@ use crate::{
|
||||
function::{ArgIntoBool, OptionalArg, OptionalOption, PyArithmeticValue, PyComparisonValue},
|
||||
pyclass::PyClassImpl,
|
||||
types::{Comparable, Constructor, Hashable, PyComparisonOp},
|
||||
AsPyObject, PyContext, PyObject, PyObjectRef, PyRef, PyResult, PyValue, TryFromBorrowedObject,
|
||||
AsObject, PyContext, PyObject, PyObjectRef, PyRef, PyResult, PyValue, TryFromBorrowedObject,
|
||||
VirtualMachine,
|
||||
};
|
||||
use bstr::ByteSlice;
|
||||
|
||||
@@ -16,7 +16,7 @@ use crate::{
|
||||
},
|
||||
utils::collection_repr,
|
||||
vm::{ReprGuard, VirtualMachine},
|
||||
AsPyObject, PyContext, PyObject, PyObjectRef, PyObjectView, PyObjectWrap, PyRef, PyResult,
|
||||
AsObject, PyContext, PyObject, PyObjectRef, PyObjectView, PyObjectWrap, PyRef, PyResult,
|
||||
PyValue,
|
||||
};
|
||||
use std::{borrow::Cow, fmt, ops::DerefMut};
|
||||
|
||||
@@ -7,7 +7,7 @@ use crate::{
|
||||
protocol::{PyMapping, PyMappingMethods, PySequence, PySequenceMethods},
|
||||
pyclass::PyClassImpl,
|
||||
types::{AsMapping, AsSequence, Constructor, Iterable},
|
||||
AsPyObject, PyContext, PyObject, PyObjectRef, PyRef, PyResult, PyValue, TryFromObject,
|
||||
AsObject, PyContext, PyObject, PyObjectRef, PyRef, PyResult, PyValue, TryFromObject,
|
||||
VirtualMachine,
|
||||
};
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@ use crate::{
|
||||
sliceable::wrap_index,
|
||||
types::{AsBuffer, AsMapping, AsSequence, Comparable, Constructor, Hashable, PyComparisonOp},
|
||||
utils::Either,
|
||||
AsPyObject, PyContext, PyObject, PyObjectRef, PyObjectView, PyObjectWrap, PyRef, PyResult,
|
||||
AsObject, PyContext, PyObject, PyObjectRef, PyObjectView, PyObjectWrap, PyRef, PyResult,
|
||||
PyValue, TryFromBorrowedObject, TryFromObject, VirtualMachine,
|
||||
};
|
||||
use crossbeam_utils::atomic::AtomicCell;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
use super::pystr::IntoPyStrRef;
|
||||
use super::{PyDictRef, PyStr, PyStrRef, PyTypeRef};
|
||||
use crate::{
|
||||
convert::ToPyObject, function::FuncArgs, pyclass::PyClassImpl, types::GetAttr, AsPyObject,
|
||||
convert::ToPyObject, function::FuncArgs, pyclass::PyClassImpl, types::GetAttr, AsObject,
|
||||
PyContext, PyObjectRef, PyObjectView, PyRef, PyResult, PyValue, VirtualMachine,
|
||||
};
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ use crate::{
|
||||
pyclass::PyClassImpl,
|
||||
types::{Comparable, Constructor, PyComparisonOp},
|
||||
vm::ReprGuard,
|
||||
AsPyObject, PyContext, PyObject, PyRef, PyResult, PyValue, VirtualMachine,
|
||||
AsObject, PyContext, PyObject, PyRef, PyResult, PyValue, VirtualMachine,
|
||||
};
|
||||
|
||||
/// A simple attribute-based namespace.
|
||||
|
||||
@@ -5,7 +5,7 @@ use crate::{
|
||||
pyclass::PyClassImpl,
|
||||
types::PyComparisonOp,
|
||||
utils::Either,
|
||||
AsPyObject, PyContext, PyObject, PyObjectRef, PyResult, PyValue, VirtualMachine,
|
||||
AsObject, PyContext, PyObject, PyObjectRef, PyResult, PyValue, VirtualMachine,
|
||||
};
|
||||
|
||||
/// object()
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
use super::PyTypeRef;
|
||||
use crate::common::lock::PyRwLock;
|
||||
use crate::{
|
||||
function::FuncArgs, pyclass::PyClassImpl, types::GetDescriptor, AsPyObject, PyContext,
|
||||
function::FuncArgs, pyclass::PyClassImpl, types::GetDescriptor, AsObject, PyContext,
|
||||
PyObjectRef, PyRef, PyResult, PyValue, TryFromObject, VirtualMachine,
|
||||
};
|
||||
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
use super::{PyInt, PyStrRef, PyTypeRef};
|
||||
use crate::{
|
||||
convert::ToPyObject, function::OptionalArg, pyclass::PyClassImpl, types::Constructor,
|
||||
AsPyObject, PyContext, PyObject, PyObjectRef, PyResult, PyValue, TryFromBorrowedObject,
|
||||
VirtualMachine,
|
||||
convert::ToPyObject, function::OptionalArg, pyclass::PyClassImpl, types::Constructor, AsObject,
|
||||
PyContext, PyObject, PyObjectRef, PyResult, PyValue, TryFromBorrowedObject, VirtualMachine,
|
||||
};
|
||||
use num_bigint::Sign;
|
||||
use num_traits::Zero;
|
||||
|
||||
@@ -16,7 +16,7 @@ use crate::{
|
||||
AsMapping, AsSequence, Comparable, Constructor, Hashable, IterNext, IterNextIterable,
|
||||
Iterable, PyComparisonOp, Unconstructible,
|
||||
},
|
||||
AsPyObject, PyContext, PyObject, PyObjectRef, PyObjectView, PyRef, PyResult, PyValue,
|
||||
AsObject, PyContext, PyObject, PyObjectRef, PyObjectView, PyRef, PyResult, PyValue,
|
||||
TryFromBorrowedObject, VirtualMachine,
|
||||
};
|
||||
use ascii::{AsciiStr, AsciiString};
|
||||
|
||||
@@ -8,7 +8,7 @@ use crate::{
|
||||
function::OptionalArg,
|
||||
pyclass::PyClassImpl,
|
||||
types::{Constructor, GetAttr, GetDescriptor},
|
||||
AsPyObject, PyContext, PyObjectRef, PyRef, PyResult, PyValue, VirtualMachine,
|
||||
AsObject, PyContext, PyObjectRef, PyRef, PyResult, PyValue, VirtualMachine,
|
||||
};
|
||||
|
||||
#[pyclass(module = false, name = "super")]
|
||||
|
||||
@@ -11,7 +11,7 @@ use crate::{
|
||||
function::{FuncArgs, KwArgs, OptionalArg},
|
||||
pyclass::{PyClassImpl, StaticType},
|
||||
types::{Callable, GetAttr, PyTypeFlags, PyTypeSlots, SetAttr},
|
||||
AsPyObject, PyContext, PyObjectRef, PyObjectWeak, PyRef, PyResult, PyValue, VirtualMachine,
|
||||
AsObject, PyContext, PyObjectRef, PyObjectWeak, PyRef, PyResult, PyValue, VirtualMachine,
|
||||
};
|
||||
use itertools::Itertools;
|
||||
use std::{
|
||||
|
||||
@@ -7,7 +7,7 @@ use crate::{
|
||||
protocol::PyMappingMethods,
|
||||
pyclass::PyClassImpl,
|
||||
types::{AsMapping, Comparable, GetAttr, Hashable, Iterable, PyComparisonOp},
|
||||
AsPyObject, PyContext, PyObject, PyObjectRef, PyObjectView, PyRef, PyResult, PyValue,
|
||||
AsObject, PyContext, PyObject, PyObjectRef, PyObjectView, PyRef, PyResult, PyValue,
|
||||
TryFromObject, VirtualMachine,
|
||||
};
|
||||
use std::fmt;
|
||||
|
||||
@@ -9,7 +9,7 @@ use crate::{
|
||||
AsMapping, AsSequence, Comparable, Constructor, Hashable, IterNext, IterNextIterable,
|
||||
Iterable, PyComparisonOp, Unconstructible,
|
||||
},
|
||||
AsPyObject, PyContext, PyObject, PyObjectRef, PyObjectView, PyRef, PyResult, PyValue,
|
||||
AsObject, PyContext, PyObject, PyObjectRef, PyObjectView, PyRef, PyResult, PyValue,
|
||||
TryFromObject, VirtualMachine,
|
||||
};
|
||||
use crossbeam_utils::atomic::AtomicCell;
|
||||
|
||||
@@ -17,7 +17,7 @@ use crate::{
|
||||
},
|
||||
utils::collection_repr,
|
||||
vm::{ReprGuard, VirtualMachine},
|
||||
AsPyObject, PyContext, PyObject, PyObjectRef, PyRef, PyResult, PyValue, TryFromObject,
|
||||
AsObject, PyContext, PyObject, PyObjectRef, PyRef, PyResult, PyValue, TryFromObject,
|
||||
};
|
||||
use std::borrow::Cow;
|
||||
use std::{fmt, ops::Deref};
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
use super::PyTypeRef;
|
||||
use crate::{
|
||||
convert::ToPyObject, pyclass::PyClassImpl, types::Constructor, AsPyObject, PyContext,
|
||||
convert::ToPyObject, pyclass::PyClassImpl, types::Constructor, AsObject, PyContext,
|
||||
PyObjectRef, PyResult, PyValue, VirtualMachine,
|
||||
};
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ use crate::{
|
||||
function::{FuncArgs, OptionalArg, PyComparisonValue},
|
||||
pyclass::PyClassImpl,
|
||||
types::{Comparable, Constructor, Hashable, PyComparisonOp, Unhashable},
|
||||
AsPyObject, PyContext, PyObject, PyObjectRef, PyRef, PyResult, PyValue, VirtualMachine,
|
||||
AsObject, PyContext, PyObject, PyObjectRef, PyRef, PyResult, PyValue, VirtualMachine,
|
||||
};
|
||||
use num_bigint::{BigInt, ToBigInt};
|
||||
use num_traits::{One, Signed, ToPrimitive, Zero};
|
||||
|
||||
@@ -14,7 +14,7 @@ use crate::{
|
||||
},
|
||||
utils::collection_repr,
|
||||
vm::{ReprGuard, VirtualMachine},
|
||||
AsPyObject, PyContext, PyObject, PyObjectRef, PyRef, PyResult, PyValue, TryFromObject,
|
||||
AsObject, PyContext, PyObject, PyObjectRef, PyRef, PyResult, PyValue, TryFromObject,
|
||||
};
|
||||
use std::{borrow::Cow, fmt, marker::PhantomData};
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ use crate::{
|
||||
function::OptionalArg,
|
||||
pyclass::PyClassImpl,
|
||||
types::{Callable, Comparable, Constructor, Hashable, PyComparisonOp},
|
||||
AsPyObject, PyContext, PyObject, PyObjectRef, PyObjectWrap, PyRef, PyResult, PyValue,
|
||||
AsObject, PyContext, PyObject, PyObjectRef, PyObjectWrap, PyRef, PyResult, PyValue,
|
||||
VirtualMachine,
|
||||
};
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ use crate::{
|
||||
protocol::{PyIter, PyIterReturn},
|
||||
pyclass::PyClassImpl,
|
||||
types::{Constructor, IterNext, IterNextIterable},
|
||||
AsPyObject, PyContext, PyObjectRef, PyRef, PyResult, PyValue, TryFromObject, VirtualMachine,
|
||||
AsObject, PyContext, PyObjectRef, PyRef, PyResult, PyValue, TryFromObject, VirtualMachine,
|
||||
};
|
||||
use rustpython_common::atomic::{self, PyAtomic, Radium};
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ use crate::{
|
||||
sequence::{SequenceMutOp, SequenceOp},
|
||||
types::PyComparisonOp,
|
||||
utils::Either,
|
||||
AsPyObject, PyObject, PyObjectRef, PyResult, PyValue, TryFromBorrowedObject, VirtualMachine,
|
||||
AsObject, PyObject, PyObjectRef, PyResult, PyValue, TryFromBorrowedObject, VirtualMachine,
|
||||
};
|
||||
use bstr::ByteSlice;
|
||||
use itertools::Itertools;
|
||||
|
||||
+1
-1
@@ -7,7 +7,7 @@ use crate::{
|
||||
function::ArgIntoFloat,
|
||||
protocol::PyBuffer,
|
||||
stdlib::builtins,
|
||||
AsPyObject, PyObjectRef, PyResult, TryFromBorrowedObject, TryFromObject, VirtualMachine,
|
||||
AsObject, PyObjectRef, PyResult, TryFromBorrowedObject, TryFromObject, VirtualMachine,
|
||||
};
|
||||
use itertools::Itertools;
|
||||
use num_bigint::{BigInt, Sign};
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@ use crate::{
|
||||
builtins::{PyBaseExceptionRef, PyBytesRef, PyStr, PyStrRef, PyTuple, PyTupleRef},
|
||||
common::{ascii, lock::PyRwLock},
|
||||
convert::ToPyObject,
|
||||
AsPyObject, PyContext, PyObject, PyObjectRef, PyResult, PyValue, TryFromObject, VirtualMachine,
|
||||
AsObject, PyContext, PyObject, PyObjectRef, PyResult, PyValue, TryFromObject, VirtualMachine,
|
||||
};
|
||||
use std::{borrow::Cow, collections::HashMap, fmt::Write, ops::Range};
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
use crate::{
|
||||
pyobject::{AsPyObject, PyObject, PyRef, PyResult, PyValue},
|
||||
pyobject::{AsObject, PyObject, PyRef, PyResult, PyValue},
|
||||
vm::VirtualMachine,
|
||||
};
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
use crate::{
|
||||
pyobject::{AsPyObject, PyObject, PyObjectRef, PyRef, PyResult, PyValue},
|
||||
pyobject::{AsObject, PyObject, PyObjectRef, PyRef, PyResult, PyValue},
|
||||
vm::VirtualMachine,
|
||||
};
|
||||
|
||||
|
||||
+1
-1
@@ -3,7 +3,7 @@ use crate::{
|
||||
common::lock::PyMutex,
|
||||
frame::{ExecutionResult, FrameRef},
|
||||
protocol::PyIterReturn,
|
||||
AsPyObject, PyObject, PyObjectRef, PyResult, VirtualMachine,
|
||||
AsObject, PyObject, PyObjectRef, PyResult, VirtualMachine,
|
||||
};
|
||||
use crossbeam_utils::atomic::AtomicCell;
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ use crate::common::{
|
||||
use crate::{
|
||||
builtins::{PyInt, PyStr, PyStrRef},
|
||||
convert::ToPyObject,
|
||||
AsPyObject, PyObject, PyObjectRef, PyRefExact, PyResult, VirtualMachine,
|
||||
AsObject, PyObject, PyObjectRef, PyRefExact, PyResult, VirtualMachine,
|
||||
};
|
||||
use num_traits::ToPrimitive;
|
||||
use std::{fmt, mem::size_of, ops::ControlFlow};
|
||||
|
||||
@@ -10,7 +10,7 @@ use crate::{
|
||||
pyclass::{PyClassImpl, StaticType},
|
||||
stdlib::sys,
|
||||
suggestion::offer_suggestions,
|
||||
AsPyObject, PyContext, PyObjectRef, PyRef, PyResult, PyValue, TryFromObject, VirtualMachine,
|
||||
AsObject, PyContext, PyObjectRef, PyRef, PyResult, PyValue, TryFromObject, VirtualMachine,
|
||||
};
|
||||
use crossbeam_utils::atomic::AtomicCell;
|
||||
use itertools::Itertools;
|
||||
|
||||
+1
-1
@@ -4,7 +4,7 @@ use crate::{
|
||||
convert::ToPyException,
|
||||
function::FuncArgs,
|
||||
stdlib::builtins,
|
||||
AsPyObject, PyObject, PyObjectRef, PyResult, VirtualMachine,
|
||||
AsObject, PyObject, PyObjectRef, PyResult, VirtualMachine,
|
||||
};
|
||||
use itertools::{Itertools, PeekingNext};
|
||||
use num_bigint::{BigInt, Sign};
|
||||
|
||||
+1
-1
@@ -16,7 +16,7 @@ use crate::{
|
||||
scope::Scope,
|
||||
stdlib::builtins,
|
||||
types::PyComparisonOp,
|
||||
AsPyObject, PyMethod, PyObject, PyObjectRef, PyObjectWrap, PyRef, PyResult, PyValue,
|
||||
AsObject, PyMethod, PyObject, PyObjectRef, PyObjectWrap, PyRef, PyResult, PyValue,
|
||||
TryFromObject, VirtualMachine,
|
||||
};
|
||||
use indexmap::IndexMap;
|
||||
|
||||
+1
-1
@@ -7,7 +7,7 @@ use crate::{
|
||||
builtins::{PyBaseExceptionRef, PyTupleRef, PyTypeRef},
|
||||
convert::{ToPyObject, ToPyResult},
|
||||
pyobject::PyThreadingConstraint,
|
||||
AsPyObject, PyObject, PyObjectRef, PyRef, PyResult, PyValue, TryFromObject, VirtualMachine,
|
||||
AsObject, PyObject, PyObjectRef, PyRef, PyResult, PyValue, TryFromObject, VirtualMachine,
|
||||
};
|
||||
use indexmap::IndexMap;
|
||||
use itertools::Itertools;
|
||||
|
||||
@@ -3,7 +3,7 @@ use crate::{
|
||||
builtins::{iter::PySequenceIterator, PyDict, PyDictRef},
|
||||
convert::ToPyObject,
|
||||
protocol::{PyIter, PyIterIter, PyMapping, PyMappingMethods},
|
||||
AsPyObject, PyObject, PyObjectRef, PyObjectWrap, PyResult, PyValue, TryFromObject,
|
||||
AsObject, PyObject, PyObjectRef, PyObjectWrap, PyResult, PyValue, TryFromObject,
|
||||
VirtualMachine,
|
||||
};
|
||||
use std::{borrow::Borrow, marker::PhantomData};
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
use crate::{
|
||||
convert::{ToPyObject, TryFromObject},
|
||||
pyobject::{AsPyObject, PyObjectRef, PyResult},
|
||||
pyobject::{AsObject, PyObjectRef, PyResult},
|
||||
VirtualMachine,
|
||||
};
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
use crate::{AsPyObject, PyObjectRef, PyResult, TryFromObject, VirtualMachine};
|
||||
use crate::{AsObject, PyObjectRef, PyResult, TryFromObject, VirtualMachine};
|
||||
use num_complex::Complex64;
|
||||
|
||||
/// A Python complex-like object.
|
||||
|
||||
+1
-1
@@ -8,7 +8,7 @@ use crate::{
|
||||
scope::Scope,
|
||||
version::get_git_revision,
|
||||
vm::{InitParameter, VirtualMachine},
|
||||
AsPyObject, PyObjectRef, PyRef, PyResult, PyValue, TryFromObject,
|
||||
AsObject, PyObjectRef, PyRef, PyResult, PyValue, TryFromObject,
|
||||
};
|
||||
use rand::Rng;
|
||||
|
||||
|
||||
+1
-1
@@ -89,7 +89,7 @@ mod pyobject {
|
||||
pub use self::convert::{TryFromBorrowedObject, TryFromObject};
|
||||
// pyobject items
|
||||
pub use self::pyobject::{
|
||||
AsPyObject, PyContext, PyMethod, PyObjectWrap, PyRefExact, PyResult, PyStructSequence, PyValue,
|
||||
AsObject, PyContext, PyMethod, PyObjectWrap, PyRefExact, PyResult, PyStructSequence, PyValue,
|
||||
};
|
||||
// pyobjectrc items
|
||||
pub use self::pyobject::{PyObject, PyObjectRef, PyObjectView, PyObjectWeak, PyRef, PyWeakRef};
|
||||
|
||||
+1
-1
@@ -49,7 +49,7 @@ macro_rules! py_namespace {
|
||||
{
|
||||
let namespace = $crate::builtins::PyNamespace::new_ref(&$vm.ctx);
|
||||
$(
|
||||
$vm.__module_set_attr($crate::pyobject::AsPyObject::as_object(&namespace), $name, $value).unwrap();
|
||||
$vm.__module_set_attr($crate::pyobject::AsObject::as_object(&namespace), $name, $value).unwrap();
|
||||
)*
|
||||
namespace
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@ use crate::{
|
||||
pyobject::PyObjectPayload,
|
||||
sliceable::wrap_index,
|
||||
types::{Constructor, Unconstructible},
|
||||
AsPyObject, PyObject, PyObjectRef, PyObjectView, PyObjectWrap, PyRef, PyResult, PyValue,
|
||||
AsObject, PyObject, PyObjectRef, PyObjectView, PyObjectWrap, PyRef, PyResult, PyValue,
|
||||
TryFromBorrowedObject, VirtualMachine,
|
||||
};
|
||||
use itertools::Itertools;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
use crate::{
|
||||
builtins::iter::PySequenceIterator,
|
||||
convert::{ToPyObject, ToPyResult},
|
||||
AsPyObject, PyObject, PyObjectRef, PyObjectWrap, PyResult, PyValue, TryFromObject,
|
||||
AsObject, PyObject, PyObjectRef, PyObjectWrap, PyResult, PyValue, TryFromObject,
|
||||
VirtualMachine,
|
||||
};
|
||||
use std::borrow::Borrow;
|
||||
|
||||
@@ -5,7 +5,7 @@ use crate::{
|
||||
},
|
||||
common::lock::OnceCell,
|
||||
convert::ToPyResult,
|
||||
AsPyObject, PyObject, PyObjectRef, PyResult, VirtualMachine,
|
||||
AsObject, PyObject, PyObjectRef, PyResult, VirtualMachine,
|
||||
};
|
||||
|
||||
// Mapping protocol
|
||||
@@ -91,13 +91,13 @@ impl PyMapping<'_> {
|
||||
})?
|
||||
}
|
||||
|
||||
pub fn subscript(&self, needle: &impl AsPyObject, vm: &VirtualMachine) -> PyResult {
|
||||
pub fn subscript(&self, needle: &impl AsObject, vm: &VirtualMachine) -> PyResult {
|
||||
self._subscript(needle.as_object(), vm)
|
||||
}
|
||||
|
||||
pub fn ass_subscript(
|
||||
&self,
|
||||
needle: &impl AsPyObject,
|
||||
needle: &impl AsObject,
|
||||
value: Option<PyObjectRef>,
|
||||
vm: &VirtualMachine,
|
||||
) -> PyResult<()> {
|
||||
|
||||
@@ -14,7 +14,7 @@ use crate::{
|
||||
protocol::{PyIter, PyMapping, PySequence},
|
||||
types::{Constructor, PyComparisonOp},
|
||||
utils::Either,
|
||||
AsPyObject, PyObject, PyObjectRef, PyResult, TryFromObject, VirtualMachine,
|
||||
AsObject, PyObject, PyObjectRef, PyResult, TryFromObject, VirtualMachine,
|
||||
};
|
||||
|
||||
// RustPython doesn't need these items
|
||||
|
||||
@@ -4,7 +4,7 @@ use crate::{
|
||||
convert::ToPyObject,
|
||||
function::PyArithmeticValue,
|
||||
protocol::PyMapping,
|
||||
AsPyObject, PyObject, PyObjectRef, PyResult, PyValue, VirtualMachine,
|
||||
AsObject, PyObject, PyObjectRef, PyResult, PyValue, VirtualMachine,
|
||||
};
|
||||
use itertools::Itertools;
|
||||
use std::{
|
||||
|
||||
+1
-1
@@ -4,7 +4,7 @@ use serde::de::{DeserializeSeed, Visitor};
|
||||
use serde::ser::{Serialize, SerializeMap, SerializeSeq};
|
||||
|
||||
use crate::builtins::{dict::PyDictRef, float, int, list::PyList, pybool, tuple::PyTuple, PyStr};
|
||||
use crate::{AsPyObject, PyObject, PyObjectRef, VirtualMachine};
|
||||
use crate::{AsObject, PyObject, PyObjectRef, VirtualMachine};
|
||||
|
||||
#[inline]
|
||||
pub fn serialize<S>(
|
||||
|
||||
+4
-4
@@ -398,7 +398,7 @@ impl<T: PyValue> ToPyObject for PyRefExact<T> {
|
||||
}
|
||||
}
|
||||
|
||||
pub trait AsPyObject
|
||||
pub trait AsObject
|
||||
where
|
||||
Self: Borrow<PyObject>,
|
||||
{
|
||||
@@ -415,7 +415,7 @@ where
|
||||
#[inline(always)]
|
||||
fn is<T>(&self, other: &T) -> bool
|
||||
where
|
||||
T: AsPyObject,
|
||||
T: AsObject,
|
||||
{
|
||||
self.get_id() == other.get_id()
|
||||
}
|
||||
@@ -437,7 +437,7 @@ where
|
||||
}
|
||||
}
|
||||
|
||||
impl<T> AsPyObject for T where T: Borrow<PyObject> {}
|
||||
impl<T> AsObject for T where T: Borrow<PyObject> {}
|
||||
|
||||
impl PyObject {
|
||||
#[inline(always)]
|
||||
@@ -687,7 +687,7 @@ pub trait PyStructSequence: StaticType + PyClassImpl + Sized + 'static {
|
||||
|
||||
pub trait PyObjectWrap
|
||||
where
|
||||
Self: AsPyObject,
|
||||
Self: AsObject,
|
||||
{
|
||||
fn into_object(self) -> PyObjectRef;
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@ use crate::common::linked_list::{Link, LinkedList, Pointers};
|
||||
use crate::common::lock::{PyMutex, PyMutexGuard, PyRwLock};
|
||||
use crate::common::refcount::RefCount;
|
||||
use crate::{
|
||||
_pyobject::{AsPyObject, PyObjectPayload, PyObjectWrap, PyResult},
|
||||
_pyobject::{AsObject, PyObjectPayload, PyObjectWrap, PyResult},
|
||||
builtins::{PyBaseExceptionRef, PyDictRef, PyTypeRef},
|
||||
vm::VirtualMachine,
|
||||
};
|
||||
|
||||
+1
-1
@@ -3,7 +3,7 @@ use crate::{
|
||||
types::{richcompare_wrapper, PyComparisonOp, RichCompareFunc},
|
||||
utils::Either,
|
||||
vm::VirtualMachine,
|
||||
AsPyObject, PyObject, PyObjectRef, PyResult,
|
||||
AsObject, PyObject, PyObjectRef, PyResult,
|
||||
};
|
||||
use itertools::Itertools;
|
||||
use optional::Optioned;
|
||||
|
||||
+1
-1
@@ -7,7 +7,7 @@ use crate::{
|
||||
int::PyInt,
|
||||
slice::{PySlice, SaturatedSliceIter},
|
||||
},
|
||||
AsPyObject, PyObject, PyResult, TryFromBorrowedObject, VirtualMachine,
|
||||
AsObject, PyObject, PyResult, TryFromBorrowedObject, VirtualMachine,
|
||||
};
|
||||
|
||||
pub trait SliceableSequenceMutOp {
|
||||
|
||||
@@ -8,7 +8,7 @@ mod gen;
|
||||
use crate::{
|
||||
builtins::{self, PyStrRef, PyTypeRef},
|
||||
pyclass::{PyClassImpl, StaticType},
|
||||
AsPyObject, PyContext, PyObject, PyObjectRef, PyResult, PyValue, TryFromObject, VirtualMachine,
|
||||
AsObject, PyContext, PyObject, PyObjectRef, PyResult, PyValue, TryFromObject, VirtualMachine,
|
||||
};
|
||||
use num_complex::Complex64;
|
||||
use num_traits::{ToPrimitive, Zero};
|
||||
@@ -21,7 +21,7 @@ use rustpython_parser::parser;
|
||||
#[pymodule]
|
||||
mod _ast {
|
||||
use crate::{
|
||||
builtins::PyStrRef, function::FuncArgs, AsPyObject, PyObjectRef, PyResult, PyValue,
|
||||
builtins::PyStrRef, function::FuncArgs, AsObject, PyObjectRef, PyResult, PyValue,
|
||||
VirtualMachine,
|
||||
};
|
||||
#[pyattr]
|
||||
|
||||
@@ -3,7 +3,7 @@ pub(crate) use atexit::make_module;
|
||||
|
||||
#[pymodule]
|
||||
mod atexit {
|
||||
use crate::{function::FuncArgs, AsPyObject, PyObjectRef, PyResult, VirtualMachine};
|
||||
use crate::{function::FuncArgs, AsObject, PyObjectRef, PyResult, VirtualMachine};
|
||||
|
||||
#[pyfunction]
|
||||
fn register(func: PyObjectRef, args: FuncArgs, vm: &VirtualMachine) -> PyObjectRef {
|
||||
|
||||
@@ -33,7 +33,7 @@ mod builtins {
|
||||
stdlib::sys,
|
||||
types::PyComparisonOp,
|
||||
utils::Either,
|
||||
AsPyObject, PyObject, PyObjectRef, PyObjectWrap, PyRef, PyResult, PyValue, TryFromObject,
|
||||
AsObject, PyObject, PyObjectRef, PyObjectWrap, PyRef, PyResult, PyValue, TryFromObject,
|
||||
VirtualMachine,
|
||||
};
|
||||
use num_traits::{Signed, ToPrimitive, Zero};
|
||||
|
||||
@@ -7,7 +7,7 @@ mod _codecs {
|
||||
builtins::{PyBaseExceptionRef, PyBytes, PyBytesRef, PyStr, PyStrRef, PyTuple},
|
||||
codecs,
|
||||
function::{ArgBytesLike, FuncArgs},
|
||||
AsPyObject, PyObject, PyObjectRef, PyResult, TryFromBorrowedObject, VirtualMachine,
|
||||
AsObject, PyObject, PyObjectRef, PyResult, TryFromBorrowedObject, VirtualMachine,
|
||||
};
|
||||
use std::ops::Range;
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@ mod _collections {
|
||||
},
|
||||
utils::collection_repr,
|
||||
vm::ReprGuard,
|
||||
AsPyObject, PyObject, PyObjectRef, PyRef, PyResult, PyValue, VirtualMachine,
|
||||
AsObject, PyObject, PyObjectRef, PyRef, PyResult, PyValue, VirtualMachine,
|
||||
};
|
||||
use crossbeam_utils::atomic::AtomicCell;
|
||||
use std::cmp::max;
|
||||
|
||||
+2
-2
@@ -88,7 +88,7 @@ mod _io {
|
||||
types::{Constructor, Destructor, IterNext, Iterable},
|
||||
utils::Either,
|
||||
vm::{ReprGuard, VirtualMachine},
|
||||
AsPyObject, PyContext, PyObject, PyObjectRef, PyObjectWrap, PyRef, PyResult, PyValue,
|
||||
AsObject, PyContext, PyObject, PyObjectRef, PyObjectWrap, PyRef, PyResult, PyValue,
|
||||
TryFromBorrowedObject, TryFromObject,
|
||||
};
|
||||
use bstr::ByteSlice;
|
||||
@@ -3660,7 +3660,7 @@ mod fileio {
|
||||
crt_fd::Fd,
|
||||
function::{ArgBytesLike, ArgMemoryBuffer, FuncArgs, OptionalArg, OptionalOption},
|
||||
stdlib::os,
|
||||
AsPyObject, PyObjectRef, PyRef, PyResult, PyValue, TryFromObject, VirtualMachine,
|
||||
AsObject, PyObjectRef, PyRef, PyResult, PyValue, TryFromObject, VirtualMachine,
|
||||
};
|
||||
use crossbeam_utils::atomic::AtomicCell;
|
||||
use std::io::{Read, Write};
|
||||
|
||||
@@ -13,7 +13,7 @@ mod decl {
|
||||
protocol::{PyIter, PyIterReturn},
|
||||
stdlib::sys,
|
||||
types::{Constructor, IterNext, IterNextIterable},
|
||||
AsPyObject, PyObjectRef, PyObjectView, PyRef, PyResult, PyValue, PyWeakRef, VirtualMachine,
|
||||
AsObject, PyObjectRef, PyObjectView, PyRef, PyResult, PyValue, PyWeakRef, VirtualMachine,
|
||||
};
|
||||
use crossbeam_utils::atomic::AtomicCell;
|
||||
use num_bigint::BigInt;
|
||||
|
||||
@@ -11,7 +11,7 @@ mod decl {
|
||||
convert::ToPyObject,
|
||||
function::ArgBytesLike,
|
||||
protocol::PyBuffer,
|
||||
pyobject::AsPyObject,
|
||||
pyobject::AsObject,
|
||||
PyObjectRef, PyResult, TryFromObject, VirtualMachine,
|
||||
};
|
||||
/// TODO
|
||||
|
||||
@@ -20,7 +20,7 @@ mod _operator {
|
||||
},
|
||||
utils::Either,
|
||||
vm::ReprGuard,
|
||||
AsPyObject, PyObjectRef, PyObjectView, PyRef, PyResult, PyValue, VirtualMachine,
|
||||
AsObject, PyObjectRef, PyObjectView, PyRef, PyResult, PyValue, VirtualMachine,
|
||||
};
|
||||
|
||||
/// Same as a < b.
|
||||
|
||||
+2
-2
@@ -4,7 +4,7 @@ use crate::{
|
||||
crt_fd::Fd,
|
||||
function::{ArgumentError, FromArgs, FuncArgs},
|
||||
protocol::PyBuffer,
|
||||
AsPyObject, PyObject, PyObjectRef, PyResult, PyValue, TryFromBorrowedObject, TryFromObject,
|
||||
AsObject, PyObject, PyObjectRef, PyResult, PyValue, TryFromBorrowedObject, TryFromObject,
|
||||
VirtualMachine,
|
||||
};
|
||||
use std::{
|
||||
@@ -442,7 +442,7 @@ pub(super) mod _os {
|
||||
types::{IterNext, IterNextIterable},
|
||||
utils::Either,
|
||||
vm::{ReprGuard, VirtualMachine},
|
||||
AsPyObject, PyObjectRef, PyRef, PyResult, PyStructSequence, PyValue, TryFromObject,
|
||||
AsObject, PyObjectRef, PyRef, PyResult, PyStructSequence, PyValue, TryFromObject,
|
||||
};
|
||||
use crossbeam_utils::atomic::AtomicCell;
|
||||
use itertools::Itertools;
|
||||
|
||||
@@ -38,7 +38,7 @@ pub mod module {
|
||||
},
|
||||
types::Constructor,
|
||||
utils::{Either, ToCString},
|
||||
AsPyObject, PyObjectRef, PyResult, PyValue, VirtualMachine,
|
||||
AsObject, PyObjectRef, PyResult, PyValue, VirtualMachine,
|
||||
};
|
||||
use bitflags::bitflags;
|
||||
use nix::{
|
||||
@@ -558,7 +558,7 @@ pub mod module {
|
||||
target_os = "android"
|
||||
))]
|
||||
fn try_to_libc(&self, vm: &VirtualMachine) -> PyResult<libc::sched_param> {
|
||||
use crate::AsPyObject;
|
||||
use crate::AsObject;
|
||||
let priority_class = self.sched_priority.class();
|
||||
let priority_type = priority_class.name();
|
||||
let priority = self.sched_priority.clone();
|
||||
|
||||
@@ -5,7 +5,7 @@ mod pwd {
|
||||
use crate::{
|
||||
builtins::{PyIntRef, PyStrRef},
|
||||
convert::{ToPyException, ToPyObject},
|
||||
AsPyObject, PyObjectRef, PyResult, PyStructSequence, VirtualMachine,
|
||||
AsObject, PyObjectRef, PyResult, PyStructSequence, VirtualMachine,
|
||||
};
|
||||
use nix::unistd::{self, User};
|
||||
use std::ptr::NonNull;
|
||||
|
||||
@@ -11,7 +11,7 @@ pub(crate) mod _thread {
|
||||
py_io,
|
||||
types::{Constructor, GetAttr, SetAttr},
|
||||
utils::Either,
|
||||
AsPyObject, PyObjectRef, PyRef, PyResult, PyValue, VirtualMachine,
|
||||
AsObject, PyObjectRef, PyRef, PyResult, PyValue, VirtualMachine,
|
||||
};
|
||||
use parking_lot::{
|
||||
lock_api::{RawMutex as RawMutexT, RawMutexTimed, RawReentrantMutex},
|
||||
|
||||
@@ -5,7 +5,7 @@ mod _warnings {
|
||||
use crate::{
|
||||
builtins::{PyStrRef, PyTypeRef},
|
||||
function::OptionalArg,
|
||||
AsPyObject, PyResult, VirtualMachine,
|
||||
AsObject, PyResult, VirtualMachine,
|
||||
};
|
||||
|
||||
#[derive(FromArgs)]
|
||||
|
||||
@@ -2,7 +2,7 @@ use crate::{
|
||||
builtins::{PyStr, PyStrRef},
|
||||
exceptions::types::PyBaseExceptionRef,
|
||||
sliceable::SliceableSequenceOp,
|
||||
AsPyObject, PyObjectRef, PyObjectView, VirtualMachine,
|
||||
AsObject, PyObjectRef, PyObjectView, VirtualMachine,
|
||||
};
|
||||
use rustpython_common::str::levenshtein::{levenshtein_distance, MOVE_COST};
|
||||
use std::iter::ExactSizeIterator;
|
||||
|
||||
@@ -8,7 +8,7 @@ use crate::{
|
||||
PyBuffer, PyIterReturn, PyMapping, PyMappingMethods, PySequence, PySequenceMethods,
|
||||
},
|
||||
utils::Either,
|
||||
AsPyObject, PyObject, PyObjectRef, PyObjectView, PyRef, PyResult, PyValue, VirtualMachine,
|
||||
AsObject, PyObject, PyObjectRef, PyObjectView, PyRef, PyResult, PyValue, VirtualMachine,
|
||||
};
|
||||
use crossbeam_utils::atomic::AtomicCell;
|
||||
use num_traits::{Signed, ToPrimitive};
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
use crate::{
|
||||
builtins::{PyFloat, PyStr},
|
||||
convert::{ToPyException, ToPyObject},
|
||||
AsPyObject, PyObject, PyObjectRef, PyObjectWrap, PyResult, TryFromObject, VirtualMachine,
|
||||
AsObject, PyObject, PyObjectRef, PyObjectWrap, PyResult, TryFromObject, VirtualMachine,
|
||||
};
|
||||
use num_traits::ToPrimitive;
|
||||
use std::borrow::Borrow;
|
||||
|
||||
+2
-2
@@ -24,7 +24,7 @@ use crate::{
|
||||
import,
|
||||
protocol::PyIterIter,
|
||||
scope::Scope,
|
||||
signal, stdlib, AsPyObject, PyContext, PyObject, PyObjectRef, PyRef, PyRefExact, PyResult,
|
||||
signal, stdlib, AsObject, PyContext, PyObject, PyObjectRef, PyRef, PyRefExact, PyResult,
|
||||
PyValue,
|
||||
};
|
||||
use crossbeam_utils::atomic::AtomicCell;
|
||||
@@ -67,7 +67,7 @@ struct ExceptionStack {
|
||||
}
|
||||
|
||||
pub(crate) mod thread {
|
||||
use super::{AsPyObject, PyObject, VirtualMachine};
|
||||
use super::{AsObject, PyObject, VirtualMachine};
|
||||
use itertools::Itertools;
|
||||
use std::{cell::RefCell, ptr::NonNull, thread_local};
|
||||
|
||||
|
||||
+3
-3
@@ -10,7 +10,7 @@ use crate::{
|
||||
convert::ToPyObject,
|
||||
scope::Scope,
|
||||
vm::VirtualMachine,
|
||||
AsPyObject, PyObject, PyObjectRef, PyObjectWrap, PyRef, PyValue,
|
||||
AsObject, PyObject, PyObjectRef, PyObjectWrap, PyRef, PyValue,
|
||||
};
|
||||
|
||||
/// Collection of object creation helpers
|
||||
@@ -288,7 +288,7 @@ impl VirtualMachine {
|
||||
pub(crate) fn new_downcast_runtime_error(
|
||||
&self,
|
||||
class: &PyTypeRef,
|
||||
obj: &impl AsPyObject,
|
||||
obj: &impl AsObject,
|
||||
) -> PyBaseExceptionRef {
|
||||
self.new_downcast_error(
|
||||
"payload",
|
||||
@@ -301,7 +301,7 @@ impl VirtualMachine {
|
||||
pub(crate) fn new_downcast_type_error(
|
||||
&self,
|
||||
class: &PyTypeRef,
|
||||
obj: &impl AsPyObject,
|
||||
obj: &impl AsObject,
|
||||
) -> PyBaseExceptionRef {
|
||||
self.new_downcast_error(
|
||||
"type",
|
||||
|
||||
+2
-2
@@ -2,7 +2,7 @@ use crate::{
|
||||
builtins::{PyBaseExceptionRef, PyList, PyStr},
|
||||
function::{FuncArgs, IntoFuncArgs},
|
||||
vm::VirtualMachine,
|
||||
AsPyObject, PyMethod, PyObject, PyObjectRef, PyResult, PyValue,
|
||||
AsObject, PyMethod, PyObject, PyObjectRef, PyResult, PyValue,
|
||||
};
|
||||
|
||||
/// Trace events for sys.settrace and sys.setprofile.
|
||||
@@ -179,7 +179,7 @@ impl VirtualMachine {
|
||||
}
|
||||
|
||||
#[inline(always)]
|
||||
pub fn invoke(&self, func: &impl AsPyObject, args: impl IntoFuncArgs) -> PyResult {
|
||||
pub fn invoke(&self, func: &impl AsObject, args: impl IntoFuncArgs) -> PyResult {
|
||||
self._invoke(func.as_object(), args.into_args(self))
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -4,7 +4,7 @@ use crate::{
|
||||
protocol::PyIterReturn,
|
||||
types::PyComparisonOp,
|
||||
vm::VirtualMachine,
|
||||
AsPyObject, PyMethod, PyObject, PyObjectRef, PyResult,
|
||||
AsObject, PyMethod, PyObject, PyObjectRef, PyResult,
|
||||
};
|
||||
|
||||
/// Collection of operators
|
||||
|
||||
@@ -7,7 +7,7 @@ use rustpython_vm::{
|
||||
compile::{CompileError, CompileErrorType},
|
||||
exceptions,
|
||||
function::{ArgBytesLike, FuncArgs},
|
||||
py_serde, AsPyObject, PyObjectRef, PyResult, PyValue, TryFromBorrowedObject, VirtualMachine,
|
||||
py_serde, AsObject, PyObjectRef, PyResult, PyValue, TryFromBorrowedObject, VirtualMachine,
|
||||
};
|
||||
use wasm_bindgen::{closure::Closure, prelude::*, JsCast};
|
||||
|
||||
|
||||
Reference in new issue
Block a user