Skip to content

Commit e6d0c4a

Browse files
authored
Add time, tzinfo, and timezone as immutable function calls (#13109)
1 parent 4e1b289 commit e6d0c4a

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

crates/ruff_python_stdlib/src/typing.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -299,8 +299,10 @@ pub fn is_mutable_return_type(qualified_name: &[&str]) -> bool {
299299
pub fn is_immutable_return_type(qualified_name: &[&str]) -> bool {
300300
matches!(
301301
qualified_name,
302-
["datetime", "date" | "datetime" | "timedelta"]
303-
| ["decimal", "Decimal"]
302+
[
303+
"datetime",
304+
"date" | "datetime" | "time" | "timedelta" | "timezone" | "tzinfo"
305+
] | ["decimal", "Decimal"]
304306
| ["fractions", "Fraction"]
305307
| ["operator", "attrgetter" | "itemgetter" | "methodcaller"]
306308
| ["pathlib", "Path"]

0 commit comments

Comments
 (0)