[red-knot] Remove an unnecessary branch and a confusing TODO comment (#14915)

This commit is contained in:
Alex Waygood 2024-12-11 16:57:40 +00:00 committed by GitHub
parent 0c85023cd9
commit ef153a0cce
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1660,12 +1660,6 @@ impl<'db> Type<'db> {
}; };
} }
if matches!(self, Type::Unknown | Type::Any | Type::Todo(_)) {
// Explicit handling of `Unknown` and `Any` necessary until `type[Unknown]` and
// `type[Any]` are not defined as `Todo` anymore.
return IterationOutcome::Iterable { element_ty: self };
}
let dunder_iter_result = self.call_dunder(db, "__iter__", &[self]); let dunder_iter_result = self.call_dunder(db, "__iter__", &[self]);
match dunder_iter_result { match dunder_iter_result {
CallDunderResult::CallOutcome(ref call_outcome) CallDunderResult::CallOutcome(ref call_outcome)