Skip to content

Commit 5bd2db8

Browse files
Merge pull request RustPython#516 from RustPython/joey/argcheck-objtype
Don't require objtype import to use arg_check! macro
2 parents 2c1afc4 + eec76ef commit 5bd2db8

24 files changed

Lines changed: 8 additions & 25 deletions

vm/src/macros.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ macro_rules! type_check {
1515
// None indicates that we have no type requirement (i.e. we accept any type)
1616
if let Some(expected_type) = $arg_type {
1717
let arg = &$args.args[$arg_count];
18-
if !objtype::isinstance(arg, &expected_type) {
18+
if !$crate::obj::objtype::isinstance(arg, &expected_type) {
1919
let arg_typ = arg.typ();
2020
let expected_type_name = $vm.to_pystr(&expected_type)?;
2121
let actual_type = $vm.to_pystr(&arg_typ)?;

vm/src/obj/objcode.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
33
*/
44

5-
use super::objtype;
65
use crate::bytecode;
76
use crate::pyobject::{
87
IdProtocol, PyContext, PyFuncArgs, PyObjectPayload, PyObjectRef, PyResult, TypeProtocol,

vm/src/obj/objenumerate.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
use super::objint;
22
use super::objiter;
3-
use super::objtype; // Required for arg_check! to use isinstance
43
use crate::pyobject::{PyContext, PyFuncArgs, PyObject, PyObjectPayload, PyResult, TypeProtocol};
54
use crate::vm::VirtualMachine;
65
use num_bigint::BigInt;

vm/src/obj/objfilter.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
use super::objbool;
22
use super::objiter;
3-
use super::objtype;
43
use crate::pyobject::{
54
IdProtocol, PyContext, PyFuncArgs, PyObject, PyObjectPayload, PyResult, TypeProtocol,
65
};

vm/src/obj/objframe.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
33
*/
44

5-
use super::objtype;
65
use crate::frame::Frame;
76
use crate::pyobject::{
87
PyContext, PyFuncArgs, PyObjectPayload, PyObjectRef, PyResult, TypeProtocol,

vm/src/obj/objfunction.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
use super::objtype;
21
use crate::pyobject::{
32
AttributeProtocol, IdProtocol, PyContext, PyFuncArgs, PyObjectPayload, PyResult, TypeProtocol,
43
};

vm/src/obj/objgenerator.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
* The mythical generator.
33
*/
44

5-
use super::objtype;
65
use crate::frame::{ExecutionResult, Frame};
76
use crate::pyobject::{
87
PyContext, PyFuncArgs, PyObject, PyObjectPayload, PyObjectRef, PyResult, TypeProtocol,

vm/src/obj/objmap.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
use super::objiter;
2-
use super::objtype;
32
use crate::pyobject::{PyContext, PyFuncArgs, PyObject, PyObjectPayload, PyResult, TypeProtocol};
43
use crate::vm::VirtualMachine; // Required for arg_check! to use isinstance
54

vm/src/obj/objmemory.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
use super::objtype;
2-
31
use crate::pyobject::{PyContext, PyFuncArgs, PyObject, PyObjectPayload, PyResult, TypeProtocol};
42
use crate::vm::VirtualMachine;
53

vm/src/obj/objnone.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
use super::objtype;
21
use crate::pyobject::{PyContext, PyFuncArgs, PyResult, TypeProtocol};
32
use crate::vm::VirtualMachine;
43

0 commit comments

Comments
 (0)