Add time, tzinfo, and timezone as immutable function calls (#13109)

This commit is contained in:
Niels Wouda 2024-08-27 16:51:32 +02:00 committed by GitHub
parent 4e1b289a67
commit e6d0c4a65d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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"]