ruff_linter 0.16.4

This is an internal component crate of Ruff
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use ruff_python_ast::PySourceType;
use ruff_python_ast::PythonVersion;
use ruff_python_stdlib::builtins::is_python_builtin;

pub(super) fn shadows_builtin(
    name: &str,
    source_type: PySourceType,
    ignorelist: &[String],
    python_version: PythonVersion,
) -> bool {
    if is_python_builtin(name, python_version.minor, source_type.is_ipynb()) {
        ignorelist.iter().all(|ignore| ignore != name)
    } else {
        false
    }
}