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

Function create_unsupported_operation

crates/vm/src/stdlib/_io.rs:5199–5218  ·  view source on GitHub ↗
(ctx: &Context)

Source from the content-addressed store, hash-verified

5197 }
5198
5199 fn create_unsupported_operation(ctx: &Context) -> PyTypeRef {
5200 use crate::builtins::type_::PyAttributes;
5201 use crate::types::PyTypeSlots;
5202
5203 let mut attrs = PyAttributes::default();
5204 attrs.insert(identifier!(ctx, __module__), ctx.new_str("io").into());
5205
5206 PyType::new_heap(
5207 "UnsupportedOperation",
5208 vec![
5209 ctx.exceptions.os_error.to_owned(),
5210 ctx.exceptions.value_error.to_owned(),
5211 ],
5212 attrs,
5213 PyTypeSlots::heap_default(),
5214 ctx.types.type_type.to_owned(),
5215 ctx,
5216 )
5217 .unwrap()
5218 }
5219
5220 pub fn unsupported_operation() -> &'static Py<PyType> {
5221 rustpython_common::static_cell! {

Callers 1

unsupported_operationFunction · 0.85

Calls 4

insertMethod · 0.45
new_strMethod · 0.45
unwrapMethod · 0.45
to_ownedMethod · 0.45

Tested by

no test coverage detected