Been debugging this issue for a while, can't seem to resolve it, this line:
enforce/enforce/decorators.py", line 145, in universal
result = wrapped(*_args, **_kwargs)
File "<string>", line 6, in __init__
AttributeError: can't set attribute
from typing import NamedTuple, Any
from dataclass.dataclasses import dataclass
from enforce import runtime_validation
class C(NamedTuple):
c: Any = None
# Also tried `C = namedtuple('C', ('c',))(None)`
@runtime_validation
@dataclass(init=True, repr=False, eq=False, order=False, unsafe_hash=True)
class A(object):
b: Any = C.c
if __name__ == "__main__":
A()
I even tried copying over the stdlib dataclass and modifying it to output what it's getting, and it's getting, for the value of b, this:
Been debugging this issue for a while, can't seem to resolve it, this line:
I even tried copying over the stdlib dataclass and modifying it to output what it's getting, and it's getting, for the value of
b
, this:It looks like it's caused by
C.c
; asC
works.Any ideas how to fix?