mypy · mypy/union-attr
union-attr
Attribute Not Defined in Union Member
An attribute is accessed on a union type but one or more union members do not define it. Narrow the type with isinstance() or other type guards before accessing the attribute.