mirror of
https://github.com/astral-sh/ruff.git
synced 2025-08-04 02:38:25 +00:00
Allow more immutable funcs for RUF009 (#4660)
This commit is contained in:
parent
12e45498e8
commit
ccca11839a
7 changed files with 155 additions and 173 deletions
|
@ -201,12 +201,18 @@ pub fn is_immutable_annotation(model: &SemanticModel, expr: &Expr) -> bool {
|
|||
}
|
||||
|
||||
const IMMUTABLE_FUNCS: &[&[&str]] = &[
|
||||
&["", "tuple"],
|
||||
&["", "bool"],
|
||||
&["", "complex"],
|
||||
&["", "float"],
|
||||
&["", "frozenset"],
|
||||
&["", "int"],
|
||||
&["", "str"],
|
||||
&["", "tuple"],
|
||||
&["datetime", "date"],
|
||||
&["datetime", "datetime"],
|
||||
&["datetime", "timedelta"],
|
||||
&["decimal", "Decimal"],
|
||||
&["fractions", "Fraction"],
|
||||
&["operator", "attrgetter"],
|
||||
&["operator", "itemgetter"],
|
||||
&["operator", "methodcaller"],
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue