MCPcopy Index your code
hub / github.com/RustPython/RustPython / create_exception_group

Function create_exception_group

crates/vm/src/exception_group.rs:17–35  ·  view source on GitHub ↗

Create dynamic ExceptionGroup type with multiple inheritance

(ctx: &Context)

Source from the content-addressed store, hash-verified

15
16/// Create dynamic ExceptionGroup type with multiple inheritance
17fn create_exception_group(ctx: &Context) -> PyRef<PyType> {
18 let excs = &ctx.exceptions;
19 let exception_group_slots = PyTypeSlots {
20 flags: PyTypeFlags::heap_type_flags() | PyTypeFlags::HAS_DICT,
21 ..Default::default()
22 };
23 PyType::new_heap(
24 "ExceptionGroup",
25 vec![
26 excs.base_exception_group.to_owned(),
27 excs.exception_type.to_owned(),
28 ],
29 Default::default(),
30 exception_group_slots,
31 ctx.types.type_type.to_owned(),
32 ctx,
33 )
34 .expect("Failed to create ExceptionGroup type with multiple inheritance")
35}
36
37pub fn exception_group() -> &'static Py<PyType> {
38 ::rustpython_vm::common::static_cell! {

Callers 1

exception_groupFunction · 0.85

Calls 1

to_ownedMethod · 0.45

Tested by

no test coverage detected