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

Method __dir__

crates/vm/src/builtins/genericalias.rs:235–243  ·  view source on GitHub ↗
(&self, vm: &VirtualMachine)

Source from the content-addressed store, hash-verified

233
234 #[pymethod]
235 fn __dir__(&self, vm: &VirtualMachine) -> PyResult<PyList> {
236 let dir = vm.dir(Some(self.__origin__()))?;
237 for exc in &ATTR_EXCEPTIONS {
238 if !dir.__contains__((*exc).to_pyobject(vm), vm)? {
239 dir.append((*exc).to_pyobject(vm));
240 }
241 }
242 Ok(dir)
243 }
244
245 #[pymethod]
246 fn __reduce__(zelf: &Py<Self>, vm: &VirtualMachine) -> PyResult<PyTupleRef> {

Callers

nothing calls this directly

Calls 6

SomeClass · 0.50
dirMethod · 0.45
__origin__Method · 0.45
__contains__Method · 0.45
to_pyobjectMethod · 0.45
appendMethod · 0.45

Tested by

no test coverage detected