We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent fc9172f commit 38ace4aCopy full SHA for 38ace4a
arraycontext/container/dataclass.py
@@ -52,9 +52,11 @@ def dataclass_array_container(cls: type) -> type:
52
"dataclass cannot have string-based type annotations"
53
54
array_fields = [
55
- f for f in fields(cls) if is_array_container_type(f.type)]
+ f for f in fields(cls)
56
+ if f.init and is_array_container_type(f.type)]
57
non_array_fields = [
- f for f in fields(cls) if not is_array_container_type(f.type)]
58
59
+ if f.init and not is_array_container_type(f.type)]
60
61
if not array_fields:
62
raise ValueError(f"'{cls}' must have fields with array container type "
0 commit comments