mypy error attr-defined
Mypy checks that an attribute is defined in the target class or module when using the dot operator.
frozen=Trueにしたdataclassで、object.__setattr__を使って属性を設定したらmypyに怒られた
self.x形式の代入ではないからattr-defined error
object.__setattr__を使わなければならないところでこのエラーが出ないようにするにはどうするのか、は宿題
別のケース:継承で発生
error: "MyEnvBuilder" has no attribute "_call_new_python" [attr-defined]
_call_new_pythonは親クラスのEnvBuilderにある
MyEnvBuilderクラスに見つからないようなので、super()するだけの_call_new_pythonメソッドを定義した
解決したが、これでいいのか不明(そもそもなぜ親クラスの_call_new_pythonをmypyは見つけられない?)