`reportUnsafeMultipleInheritance` false positive on class when an `__init__` method is present in instance of the metaclass that uses `dataclass_transform` #869
from typing import dataclass_transform
@dataclass_transform()
class A(type): ...
class Foo(metaclass=A):
def __init__(self) -> None:
print("called")
class B: ...
class Bar(Foo, B): ... # error: reportUnsafeMultipleInheritance
print(Bar()) # prints "called"
Code sample in basedpyright playground
if the
__init__
was inB
instead ofFoo
, the error would be correct. see https://github.com/DetachHead/basedpyright/issues/868#issuecomment-2472205770