File tree Expand file tree Collapse file tree 1 file changed +10
-6
lines changed Expand file tree Collapse file tree 1 file changed +10
-6
lines changed Original file line number Diff line number Diff line change 6
6
standard dataclasses module, with the following features:
7
7
8
8
1. Field-level mutability control:
9
- - Use the `mutable_during_init` decorator to mark fields that should be mutable
10
- during the initialization phase but become immutable after sealing.
9
+
10
+ Use the `mutable_during_init` decorator to mark fields that should be mutable
11
+ during the initialization phase but become immutable after sealing.
11
12
12
13
2. Two-phase initialization:
14
+
13
15
- Objects start in an "initializing" state where designated fields can be modified.
14
16
- Objects can be explicitly sealed to prevent further modification of any fields.
15
17
16
18
3. Circular reference support:
17
- - Create objects, establish circular references between them, then seal
18
- them together.
19
+
20
+ Create objects, establish circular references between them, then seal
21
+ them together.
19
22
20
23
4. Backward compatibility:
21
- - Objects are immutable by default, sealing occurs automatically at the end of
22
- initialization unless explicitly deferred.
24
+
25
+ Objects are immutable by default, sealing occurs automatically at the end of
26
+ initialization unless explicitly deferred.
23
27
24
28
Limitations:
25
29
You can’t perform that action at this time.
0 commit comments