You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Metaclass attribute becomes unknown after narrowing type[Protocol] with isinstance #5282
After isinstance(cls, Metadata), the metaclass declares a known int | None attribute. Pyrefly loses that type when the class also came from type(shape) for a protocol with a property of the same name. The same attribute accessed through a parameter annotated directly as Metadata is known. The metaclass attribute has a default here to avoid the separate initialization issue in #5278. This is related to, but narrower than, the previously closed #4168.
Reproduced with Pyrefly 1.4.0 and CPython 3.14.8 on macOS. Pyrefly 1.3.2 accepts this example with the same configuration. Mypy 2.4.0 (strict, without project plugins) and Pyright 1.1.414 also accept it.
Activity