File tree Expand file tree Collapse file tree 1 file changed +60
-0
lines changed
Expand file tree Collapse file tree 1 file changed +60
-0
lines changed Original file line number Diff line number Diff line change 2323 Tuple ,
2424 TypeVar ,
2525 Union ,
26+ dataclass_transform ,
2627)
2728
2829from ..catom import (
3536 PostValidate ,
3637 Validate ,
3738)
39+ from ..coerced import Coerced
40+ from ..containerlist import ContainerList
41+ from ..dict import DefaultDict , Dict as MDict
42+ from ..enum import Enum
43+ from ..event import Event
44+ from ..instance import Instance
45+ from ..list import List as MList
46+ from ..property import Property
47+ from ..scalars import (
48+ Bool ,
49+ Bytes ,
50+ Callable as MCallable ,
51+ Constant ,
52+ Float ,
53+ FloatRange ,
54+ Int ,
55+ Range ,
56+ ReadOnly ,
57+ Str ,
58+ Value ,
59+ )
60+ from ..set import Set as MSet
61+ from ..signal import Signal
62+ from ..tuple import Tuple as MTuple
63+ from ..typed import Typed
3864from .annotation_utils import generate_members_from_cls_namespace
3965from .member_modifiers import set_default
4066from .observation import ExtendedObserver , ObserveHandler
@@ -500,6 +526,40 @@ def create_class(self, meta: type) -> type:
500526 return cls
501527
502528
529+ @dataclass_transform (
530+ eq_default = False ,
531+ order_default = False ,
532+ kw_only_default = True ,
533+ field_specifiers = (
534+ set_default ,
535+ Member ,
536+ Coerced ,
537+ ContainerList ,
538+ DefaultDict ,
539+ MDict ,
540+ Enum ,
541+ Event ,
542+ Instance ,
543+ MList ,
544+ Property ,
545+ Bool ,
546+ Bytes ,
547+ MCallable ,
548+ Constant ,
549+ Float ,
550+ FloatRange ,
551+ Int ,
552+ Range ,
553+ ReadOnly ,
554+ Str ,
555+ Value ,
556+ MSet ,
557+ Signal ,
558+ MTuple ,
559+ Typed ,
560+ ),
561+ slots = True ,
562+ )
503563class AtomMeta (type ):
504564 """The metaclass for classes derived from Atom.
505565
You can’t perform that action at this time.
0 commit comments