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

Method has_default

crates/vm/src/stdlib/typevar.rs:228–235  ·  view source on GitHub ↗
(&self, vm: &VirtualMachine)

Source from the content-addressed store, hash-verified

226
227 #[pymethod]
228 fn has_default(&self, vm: &VirtualMachine) -> bool {
229 if !vm.is_none(&self.evaluate_default.lock()) {
230 return true;
231 }
232 let default_value = self.default_value.lock();
233 // Check if default_value is not NoDefault
234 !default_value.is(&vm.ctx.typing_no_default)
235 }
236
237 #[pymethod]
238 fn __typing_prepare_subst__(

Callers 11

test_typevarMethod · 0.95
test_typevar_noneMethod · 0.95
_collect_type_parametersFunction · 0.80
_paramspec_prepare_substFunction · 0.80
test_paramspecMethod · 0.80
test_paramspec_noneMethod · 0.80
test_typevartupleMethod · 0.80

Calls 3

isMethod · 0.80
is_noneMethod · 0.45
lockMethod · 0.45

Tested by 6

test_typevarMethod · 0.76
test_typevar_noneMethod · 0.76
test_paramspecMethod · 0.64
test_paramspec_noneMethod · 0.64
test_typevartupleMethod · 0.64