File tree 1 file changed +60
-0
lines changed
1 file changed +60
-0
lines changed Original file line number Diff line number Diff line change 24
24
Tuple ,
25
25
TypeVar ,
26
26
Union ,
27
+ dataclass_transform ,
27
28
)
28
29
29
30
from ..catom import (
36
37
PostValidate ,
37
38
Validate ,
38
39
)
40
+ from ..coerced import Coerced
41
+ from ..containerlist import ContainerList
42
+ from ..dict import DefaultDict , Dict as MDict
43
+ from ..enum import Enum
44
+ from ..event import Event
45
+ from ..instance import Instance
46
+ from ..list import List as MList
47
+ from ..property import Property
48
+ from ..scalars import (
49
+ Bool ,
50
+ Bytes ,
51
+ Callable as MCallable ,
52
+ Constant ,
53
+ Float ,
54
+ FloatRange ,
55
+ Int ,
56
+ Range ,
57
+ ReadOnly ,
58
+ Str ,
59
+ Value ,
60
+ )
61
+ from ..set import Set as MSet
62
+ from ..signal import Signal
63
+ from ..tuple import Tuple as MTuple
64
+ from ..typed import Typed
39
65
from .annotation_utils import generate_members_from_cls_namespace
40
66
from .member_modifiers import set_default
41
67
from .observation import ExtendedObserver , ObserveHandler
@@ -501,6 +527,40 @@ def create_class(self, meta: type) -> type:
501
527
return cls
502
528
503
529
530
+ @dataclass_transform (
531
+ eq_default = False ,
532
+ order_default = False ,
533
+ kw_only_default = True ,
534
+ field_specifiers = (
535
+ set_default ,
536
+ Member ,
537
+ Coerced ,
538
+ ContainerList ,
539
+ DefaultDict ,
540
+ MDict ,
541
+ Enum ,
542
+ Event ,
543
+ Instance ,
544
+ MList ,
545
+ Property ,
546
+ Bool ,
547
+ Bytes ,
548
+ MCallable ,
549
+ Constant ,
550
+ Float ,
551
+ FloatRange ,
552
+ Int ,
553
+ Range ,
554
+ ReadOnly ,
555
+ Str ,
556
+ Value ,
557
+ MSet ,
558
+ Signal ,
559
+ MTuple ,
560
+ Typed ,
561
+ ),
562
+ slots = True ,
563
+ )
504
564
class AtomMeta (type ):
505
565
"""The metaclass for classes derived from Atom.
506
566
You can’t perform that action at this time.
0 commit comments