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

Method py_new

crates/stdlib/src/select.rs:582–590  ·  view source on GitHub ↗
(_cls: &Py<PyType>, args: Self::Args, vm: &VirtualMachine)

Source from the content-addressed store, hash-verified

580 type Args = EpollNewArgs;
581
582 fn py_new(_cls: &Py<PyType>, args: Self::Args, vm: &VirtualMachine) -> PyResult<Self> {
583 if let ..=-2 | 0 = args.sizehint {
584 return Err(vm.new_value_error("negative sizehint"));
585 }
586 if !matches!(args.flags, 0 | libc::EPOLL_CLOEXEC) {
587 return Err(vm.new_os_error("invalid flags".to_owned()));
588 }
589 Self::new().map_err(|e| e.into_pyexception(vm))
590 }
591 }
592
593 #[derive(FromArgs)]

Callers

nothing calls this directly

Calls 5

newFunction · 0.85
new_os_errorMethod · 0.80
ErrClass · 0.50
to_ownedMethod · 0.45
into_pyexceptionMethod · 0.45

Tested by

no test coverage detected