New submission from simple_coder878 :
Simple example
from dataclasses import dataclass, field
@dataclass(init=False)
class TestObject(object):
m: str = field(default='hi')
k: list = field(default_factory=list)
def test(self):
print(f'm is {self.m} ')
simple_coder878 added the comment:
Also wanted to add that I did try another variation of the first example where
I set the default_factory field's init value to False and I got the same error.
from dataclasses import dataclass, field
@dataclass(init=False)
class TestObject(object):