mirror of
https://github.com/astral-sh/ruff.git
synced 2025-08-01 17:32:25 +00:00
Add time, tzinfo, and timezone as immutable function calls (#13109)
This commit is contained in:
parent
4e1b289a67
commit
e6d0c4a65d
1 changed files with 4 additions and 2 deletions
|
@ -299,8 +299,10 @@ pub fn is_mutable_return_type(qualified_name: &[&str]) -> bool {
|
||||||
pub fn is_immutable_return_type(qualified_name: &[&str]) -> bool {
|
pub fn is_immutable_return_type(qualified_name: &[&str]) -> bool {
|
||||||
matches!(
|
matches!(
|
||||||
qualified_name,
|
qualified_name,
|
||||||
["datetime", "date" | "datetime" | "timedelta"]
|
[
|
||||||
| ["decimal", "Decimal"]
|
"datetime",
|
||||||
|
"date" | "datetime" | "time" | "timedelta" | "timezone" | "tzinfo"
|
||||||
|
] | ["decimal", "Decimal"]
|
||||||
| ["fractions", "Fraction"]
|
| ["fractions", "Fraction"]
|
||||||
| ["operator", "attrgetter" | "itemgetter" | "methodcaller"]
|
| ["operator", "attrgetter" | "itemgetter" | "methodcaller"]
|
||||||
| ["pathlib", "Path"]
|
| ["pathlib", "Path"]
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue