Skip to content

Commit 8d54996

Browse files
Avoid indirection in class.__call__ lookup (#13595)
1 parent 73e884b commit 8d54996

File tree

1 file changed

+1
-2
lines changed
  • crates/red_knot_python_semantic/src

1 file changed

+1
-2
lines changed

crates/red_knot_python_semantic/src/types.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -616,8 +616,7 @@ impl<'db> Type<'db> {
616616
Type::Instance(class) => {
617617
// Since `__call__` is a dunder, we need to access it as an attribute on the class
618618
// rather than the instance (matching runtime semantics).
619-
let meta_ty = Type::Class(class);
620-
let dunder_call_method = meta_ty.member(db, "__call__");
619+
let dunder_call_method = class.class_member(db, "__call__");
621620
if dunder_call_method.is_unbound() {
622621
CallOutcome::not_callable(self)
623622
} else {

0 commit comments

Comments
 (0)