[reportUninitializedInstanceVariable
] dataclass
with ABC
: Variables defined in abstract base class are not initialized in final class
#8202
-
It would be nice to allow usage of from abc import ABC, abstractmethod
from dataclasses import dataclass
from typing import final, override
@dataclass
class Parent(ABC):
@abstractmethod
def foo() -> str: ...
p1: str
@final
@dataclass
class Child(Parent): # currently errors
p2: int
@override
def foo():
return "bar" Currently
Does anything speak against allowing above constellation with (I am not sure of the specification regarding interplay between |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
I think this it's reasonable to add special cases for I'll create a new enhancement request from this discussion thread. |
Beta Was this translation helpful? Give feedback.
Here's the new enhancement request.