This is a bug in the chex library. The chex.dataclass decorator has no type annotations despite the fact that the package contains a "py.typed" marker file.
This issue still persists. The only way to handle this is to add a # pyright: ignore at the end of the line, which is obviously not the right solution here.
Applying the
chex.dataclass
wrapper to a class yields the following error:https://github.com/microsoft/pyright/issues/6536#issuecomment-1826087060
https://github.com/microsoft/pyright/issues/6536#issuecomment-1862080880
https://github.com/python/typeshed/blob/main/stdlib/dataclasses.pyi