forked from Rust-related/RustPython
Make it unnecessary to import PyClassImpl for #[pymodule]
This commit is contained in:
@@ -318,7 +318,7 @@ impl ModuleItem for ClassItem {
|
||||
.optional_name()
|
||||
.unwrap_or_else(|| class_name.clone());
|
||||
let new_class = quote_spanned!(ident.span() =>
|
||||
#ident::make_class(&vm.ctx);
|
||||
<#ident as ::rustpython_vm::pyobject::PyClassImpl>::make_class(&vm.ctx);
|
||||
);
|
||||
let item = quote! {
|
||||
let new_class = #new_class;
|
||||
|
||||
@@ -5,9 +5,7 @@ mod _collections {
|
||||
use crate::common::cell::{PyRwLock, PyRwLockReadGuard, PyRwLockWriteGuard};
|
||||
use crate::function::OptionalArg;
|
||||
use crate::obj::{objiter, objsequence, objtype::PyTypeRef};
|
||||
use crate::pyobject::{
|
||||
PyClassImpl, PyComparisonValue, PyIterable, PyObjectRef, PyRef, PyResult, PyValue,
|
||||
};
|
||||
use crate::pyobject::{PyComparisonValue, PyIterable, PyObjectRef, PyRef, PyResult, PyValue};
|
||||
use crate::sequence;
|
||||
use crate::slots::{Comparable, PyComparisonOp};
|
||||
use crate::vm::ReprGuard;
|
||||
|
||||
@@ -7,7 +7,7 @@ mod hashlib {
|
||||
use crate::obj::objbytes::{PyBytes, PyBytesRef};
|
||||
use crate::obj::objstr::PyStrRef;
|
||||
use crate::obj::objtype::PyTypeRef;
|
||||
use crate::pyobject::{BorrowValue, PyClassImpl, PyResult, PyValue};
|
||||
use crate::pyobject::{BorrowValue, PyResult, PyValue};
|
||||
use crate::vm::VirtualMachine;
|
||||
use std::fmt;
|
||||
|
||||
|
||||
@@ -17,8 +17,8 @@ mod decl {
|
||||
use crate::obj::objtuple::PyTupleRef;
|
||||
use crate::obj::objtype::{self, PyTypeRef};
|
||||
use crate::pyobject::{
|
||||
BorrowValue, IdProtocol, IntoPyRef, PyCallable, PyClassImpl, PyObjectRc, PyObjectRef,
|
||||
PyObjectWeak, PyRef, PyResult, PyValue, TypeProtocol,
|
||||
BorrowValue, IdProtocol, IntoPyRef, PyCallable, PyObjectRc, PyObjectRef, PyObjectWeak,
|
||||
PyRef, PyResult, PyValue, TypeProtocol,
|
||||
};
|
||||
use crate::vm::VirtualMachine;
|
||||
|
||||
|
||||
@@ -7,9 +7,7 @@ mod _json {
|
||||
use crate::obj::objiter;
|
||||
use crate::obj::objstr::PyStrRef;
|
||||
use crate::obj::{objbool, objtype::PyTypeRef};
|
||||
use crate::pyobject::{
|
||||
BorrowValue, IdProtocol, PyClassImpl, PyObjectRef, PyRef, PyResult, PyValue,
|
||||
};
|
||||
use crate::pyobject::{BorrowValue, IdProtocol, PyObjectRef, PyRef, PyResult, PyValue};
|
||||
use crate::slots::Callable;
|
||||
use crate::VirtualMachine;
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@ use crate::obj::objstr::{PyStr, PyStrRef};
|
||||
use crate::obj::objtuple::PyTupleRef;
|
||||
use crate::obj::objtype::PyTypeRef;
|
||||
use crate::pyobject::{
|
||||
BorrowValue, Either, IntoPyObject, ItemProtocol, PyClassImpl, PyObjectRef, PyRef, PyResult,
|
||||
BorrowValue, Either, IntoPyObject, ItemProtocol, PyObjectRef, PyRef, PyResult,
|
||||
PyStructSequence, PyValue, TryFromObject, TypeProtocol,
|
||||
};
|
||||
use crate::vm::VirtualMachine;
|
||||
|
||||
@@ -30,7 +30,7 @@ mod _struct {
|
||||
objtuple::PyTupleRef, objtype::PyTypeRef,
|
||||
};
|
||||
use crate::pyobject::{
|
||||
BorrowValue, Either, PyClassImpl, PyObjectRef, PyRef, PyResult, PyValue, TryFromObject,
|
||||
BorrowValue, Either, PyObjectRef, PyRef, PyResult, PyValue, TryFromObject,
|
||||
};
|
||||
use crate::VirtualMachine;
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ mod _random {
|
||||
use crate::function::OptionalOption;
|
||||
use crate::obj::objint::PyIntRef;
|
||||
use crate::obj::objtype::PyTypeRef;
|
||||
use crate::pyobject::{BorrowValue, PyClassImpl, PyRef, PyResult, PyValue};
|
||||
use crate::pyobject::{BorrowValue, PyRef, PyResult, PyValue};
|
||||
use crate::VirtualMachine;
|
||||
use num_bigint::{BigInt, Sign};
|
||||
use num_traits::Signed;
|
||||
|
||||
@@ -6,7 +6,7 @@ mod decl {
|
||||
|
||||
use crate::obj::objstr::PyStrRef;
|
||||
use crate::obj::objtype::PyTypeRef;
|
||||
use crate::pyobject::{BorrowValue, PyClassImpl, PyRef, PyResult, PyValue};
|
||||
use crate::pyobject::{BorrowValue, PyRef, PyResult, PyValue};
|
||||
use crate::vm::VirtualMachine;
|
||||
use rustpython_compiler::{compile, error::CompileError, symboltable};
|
||||
use rustpython_parser::parser;
|
||||
|
||||
@@ -8,7 +8,7 @@ mod decl {
|
||||
use crate::function::OptionalArg;
|
||||
use crate::obj::objbytes::{PyBytes, PyBytesRef};
|
||||
use crate::obj::objtype::PyTypeRef;
|
||||
use crate::pyobject::{BorrowValue, IntoPyRef, PyClassImpl, PyResult, PyValue};
|
||||
use crate::pyobject::{BorrowValue, IntoPyRef, PyResult, PyValue};
|
||||
use crate::types::create_type;
|
||||
use crate::vm::VirtualMachine;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user