Skip to content

Commit

Permalink
Document PERF102 fix unsafety
Browse files Browse the repository at this point in the history
Relates to astral-sh#8482
  • Loading branch information
hauntsaninja committed Jan 2, 2024
1 parent 20def33 commit 61c067e
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,12 @@ use crate::checkers::ast::Checker;
/// for value in obj.values():
/// print(value)
/// ```
///
/// ## Fix safety
/// The fix does not perform any type analysis. The fix will be incorrect if the
/// object in question does not duck-type as a mapping, e.g. because it is
/// missing `.keys()` or `.values()` or because those methods behave differently
/// than they do on mappings.
#[violation]
pub struct IncorrectDictIterator {
subset: DictSubset,
Expand Down

0 comments on commit 61c067e

Please sign in to comment.