mirror of
https://github.com/astral-sh/ruff.git
synced 2025-08-02 09:52:18 +00:00
Avoid indirection in class.__call__
lookup (#13595)
This commit is contained in:
parent
73e884b232
commit
8d54996ffb
1 changed files with 1 additions and 2 deletions
|
@ -616,8 +616,7 @@ impl<'db> Type<'db> {
|
|||
Type::Instance(class) => {
|
||||
// Since `__call__` is a dunder, we need to access it as an attribute on the class
|
||||
// rather than the instance (matching runtime semantics).
|
||||
let meta_ty = Type::Class(class);
|
||||
let dunder_call_method = meta_ty.member(db, "__call__");
|
||||
let dunder_call_method = class.class_member(db, "__call__");
|
||||
if dunder_call_method.is_unbound() {
|
||||
CallOutcome::not_callable(self)
|
||||
} else {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue