mirror of
https://github.com/astral-sh/ruff.git
synced 2025-09-29 21:35:58 +00:00
[red-knot] a few metaclass cleanups (#14142)
Just cleaning up a few small things I noticed in post-land review.
This commit is contained in:
parent
626f716de6
commit
03a5788aa1
2 changed files with 18 additions and 11 deletions
|
@ -2100,8 +2100,10 @@ impl<'db> Class<'db> {
|
|||
};
|
||||
|
||||
let Type::ClassLiteral(mut candidate) = metaclass else {
|
||||
// If the metaclass is not a class, return it directly.
|
||||
return Ok(metaclass);
|
||||
// TODO: If the metaclass is not a class, we should verify that it's a callable
|
||||
// which accepts the same arguments as `type.__new__` (otherwise error), and return
|
||||
// the meta-type of its return type. (And validate that is a class type?)
|
||||
return Ok(Type::Todo);
|
||||
};
|
||||
|
||||
// Reconcile all base classes' metaclasses with the candidate metaclass.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue