Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

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

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions crates/ruff_python_stdlib/src/typing.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
Expand Down
Loading