From e6d0c4a65d3436ed06a5ed77fcd22c4939a5fc01 Mon Sep 17 00:00:00 2001 From: Niels Wouda Date: Tue, 27 Aug 2024 16:51:32 +0200 Subject: [PATCH] Add time, tzinfo, and timezone as immutable function calls (#13109) --- 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"]