Skip to content
Merged
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
Prev Previous commit
Next Next commit
typing.override
  • Loading branch information
youknowone committed Jun 26, 2025
commit c2f8d5bb3fd9b90c7f5409bf8877e4ff66436d34
7 changes: 7 additions & 0 deletions vm/src/stdlib/typing.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,13 @@ pub(crate) mod decl {
args.args[0].clone()
}

#[pyfunction(name = "override")]
pub(crate) fn r#override(func: PyObjectRef, vm: &VirtualMachine) -> PyResult {
// Set __override__ attribute to True
func.set_attr("__override__", vm.ctx.true_value.clone(), vm)?;
Ok(func)
}

#[pyattr]
#[pyclass(name = "TypeVar", module = "typing")]
#[derive(Debug, PyPayload)]
Expand Down