From feae1643b91dfa04ee30eb54f03bb82a72d105d9 Mon Sep 17 00:00:00 2001 From: Niels Wouda Date: Mon, 26 Aug 2024 15:20:53 +0200 Subject: [PATCH] Add time, timezone, and tzinfo as immutable function calls --- crates/ruff_python_stdlib/src/typing.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/crates/ruff_python_stdlib/src/typing.rs b/crates/ruff_python_stdlib/src/typing.rs index bfd8f7f5c04b0..ef250d2df68cf 100644 --- a/crates/ruff_python_stdlib/src/typing.rs +++ b/crates/ruff_python_stdlib/src/typing.rs @@ -299,8 +299,10 @@ pub fn is_mutable_return_type(qualified_name: &[&str]) -> bool { pub fn is_immutable_return_type(qualified_name: &[&str]) -> bool { matches!( qualified_name, - ["datetime", "date" | "datetime" | "timedelta"] - | ["decimal", "Decimal"] + [ + "datetime", + "date" | "datetime" | "time" | "timedelta" | "timezone" | "tzinfo" + ] | ["decimal", "Decimal"] | ["fractions", "Fraction"] | ["operator", "attrgetter" | "itemgetter" | "methodcaller"] | ["pathlib", "Path"]