Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
ListToTuple
  • Loading branch information
youknowone committed Jul 20, 2025
commit 7801ef48b842531db81dcbb59cda53a349cbbda4
7 changes: 7 additions & 0 deletions compiler/core/src/bytecode.rs
Original file line number Diff line number Diff line change
Expand Up @@ -392,8 +392,15 @@ op_arg_enum!(
#[derive(Copy, Clone, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum IntrinsicFunction1 {
// Invalid = 0,
// Print = 1,
/// Import * operation
ImportStar = 2,
// StopIterationError = 3,
// AsyncGenWrap = 4,
// UnaryPositive = 5,
Comment thread
youknowone marked this conversation as resolved.
/// Convert list to tuple
ListToTuple = 6,
/// Type parameter related
TypeVar = 7,
ParamSpec = 8,
Expand Down
7 changes: 7 additions & 0 deletions vm/src/frame.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2262,6 +2262,13 @@ impl ExecutingFrame<'_> {
let type_alias = typing::TypeAliasType::new(name, type_params, value);
Ok(type_alias.into_ref(&vm.ctx).into())
}
bytecode::IntrinsicFunction1::ListToTuple => {
// Convert list to tuple
let list = arg
.downcast::<PyList>()
.map_err(|_| vm.new_type_error("LIST_TO_TUPLE expects a list"))?;
Ok(vm.ctx.new_tuple(list.borrow_vec_mut().clone()).into())
Comment thread
youknowone marked this conversation as resolved.
Outdated
}
Comment thread
coderabbitai[bot] marked this conversation as resolved.
}
}

Expand Down