Skip to content

Commit

Permalink
Update crates/ruff_python_semantic/src/analyze/class.rs
Browse files Browse the repository at this point in the history
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
  • Loading branch information
charliermarsh and AlexWaygood committed Aug 9, 2024
1 parent 9796d57 commit 14035eb
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions crates/ruff_python_semantic/src/analyze/class.rs
Original file line number Diff line number Diff line change
Expand Up @@ -135,9 +135,7 @@ pub fn is_metaclass(class_def: &ast::StmtClassDef, semantic: &SemanticModel) ->
Expr::Subscript(ast::ExprSubscript { value, .. }) => {
// Ex) `class Foo(type[int]): ...`
semantic
.resolve_qualified_name(value.as_ref())
.is_some_and(|qualified_name| {
matches!(qualified_name.segments(), ["" | "builtins", "type"])
.match_builtin_expr(value.as_ref(), "type")
})
}
_ => semantic
Expand Down

0 comments on commit 14035eb

Please sign in to comment.