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

Function validate_name

crates/vm/src/stdlib/_ast/validate.rs:16–24  ·  view source on GitHub ↗
(vm: &VirtualMachine, name: &ast::name::Name)

Source from the content-addressed store, hash-verified

14}
15
16fn validate_name(vm: &VirtualMachine, name: &ast::name::Name) -> PyResult<()> {
17 match name.as_str() {
18 "None" | "True" | "False" => Err(vm.new_value_error(format!(
19 "identifier field can't represent '{}' constant",
20 name.as_str()
21 ))),
22 _ => Ok(()),
23 }
24}
25
26fn validate_comprehension(vm: &VirtualMachine, gens: &[ast::Comprehension]) -> PyResult<()> {
27 if gens.is_empty() {

Callers 4

validate_captureFunction · 0.85
validate_patternFunction · 0.85
validate_typeparamFunction · 0.85
validate_exprFunction · 0.85

Calls 2

ErrClass · 0.50
as_strMethod · 0.45

Tested by

no test coverage detected