mirror of
https://github.com/astral-sh/ruff.git
synced 2025-08-09 13:18:52 +00:00
Return a slice in StmtClassDef#bases
(#6311)
Slices are strictly more flexible, since you can always convert to an iterator, etc., but not the other way around. Suggested in https://github.com/astral-sh/ruff/pull/6259#discussion_r1282730994.
This commit is contained in:
parent
718e3945e3
commit
2fa508793f
6 changed files with 16 additions and 15 deletions
|
@ -42,7 +42,7 @@ pub fn classify(
|
|||
FunctionType::StaticMethod
|
||||
} else if matches!(name, "__new__" | "__init_subclass__" | "__class_getitem__")
|
||||
// Special-case class method, like `__new__`.
|
||||
|| class_def.bases().any(|expr| {
|
||||
|| class_def.bases().iter().any(|expr| {
|
||||
// The class itself extends a known metaclass, so all methods are class methods.
|
||||
semantic
|
||||
.resolve_call_path(map_callable(expr))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue