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 2424 Tuple ,
2525 TypeVar ,
2626 Union ,
27+ dataclass_transform ,
2728)
2829
2930from ..catom import (
3637 PostValidate ,
3738 Validate ,
3839)
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
3965from .annotation_utils import generate_members_from_cls_namespace
4066from .member_modifiers import set_default
4167from .observation import ExtendedObserver , ObserveHandler
@@ -501,6 +527,40 @@ def create_class(self, meta: type) -> type:
501527 return cls
502528
503529
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+ )
504564class AtomMeta (type ):
505565 """The metaclass for classes derived from Atom.
506566
You can’t perform that action at this time.
0 commit comments