mirror of
https://github.com/astral-sh/ruff
synced 2026-01-09 07:34:06 -05:00
## Summary This should address a problem that came up while working on https://github.com/astral-sh/ruff/pull/18280. When looking up an attribute (typically a dunder method) with the `MRO_NO_OBJECT_FALLBACK` policy, the attribute is first looked up on the meta type. If the meta type happens to be `type`, we go through the following branch in `find_name_in_mro_with_policy`:97ff015c88/crates/ty_python_semantic/src/types.rs (L2565-L2573)The problem is that we now look up the attribute on `object` *directly* (instead of just having `object` in the MRO). In this case, `MRO_NO_OBJECT_FALLBACK` has no effect in `class_member_from_mro`:c3feb8ce27/crates/ty_python_semantic/src/types/class.rs (L1081-L1082)So instead, we need to explicitly respect the `MRO_NO_OBJECT_FALLBACK` policy here by returning `Symbol::Unbound`. ## Test Plan Added new Markdown tests that explain the ecosystem changes that we observe.