8000 implement _idfunc · RustPython/RustPython@7ac2650 · GitHub
[go: up one dir, main page]

Skip to content

Commit 7ac2650

Browse files
committed
implement _idfunc
Signed-off-by: Ashwin Naren <arihant2math@gmail.com>
1 parent 1512130 commit 7ac2650

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

vm/src/stdlib/typing.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ pub(crate) mod _typing {
55
use crate::{
66
PyObjectRef, PyPayload, PyResult, VirtualMachine,
77
builtins::{PyGenericAlias, PyTupleRef, PyTypeRef, pystr::AsPyStr},
8-
function::IntoFuncArgs,
8+
function::{IntoFuncArgs, FuncArgs},
99
};
1010

1111
pub(crate) fn _call_typing_func_object<'a>(
@@ -20,8 +20,10 @@ pub(crate) mod _typing {
2020
// func.call(args, vm)
2121
}
2222

23-
#[pyattr]
24-
pub(crate) fn _idfunc(_vm: &VirtualMachine) {}
23+
#[pyfunction]
24+
pub(crate) fn _idfunc(args: FuncArgs, _vm: &VirtualMachine) -> PyObjectRef {
25+
args.args[0].clone()
26+
}
2527

2628
#[pyattr]
2729
#[pyclass(name = "TypeVar")]

0 commit comments

Comments
 (0)
0