@@ -80,6 +80,10 @@ sync will make it easier for dataclass users to understand and use
80
80
``dataclass_transform `` and will simplify the maintenance of dataclass
81
81
support in type checkers.
82
82
83
+ Additionally, we will consider adding ``dataclass_transform `` support
84
+ in the future for features that have been adopted by multiple
85
+ third-party libraries but are not supported by dataclasses.
86
+
83
87
84
88
Specification
85
89
=============
@@ -607,10 +611,7 @@ annotations but with no assignment should be treated as data fields.
607
611
608
612
We considered supporting ``auto_attribs `` and a corresponding
609
613
``auto_attribs_default `` parameter, but decided against this because it
610
- is specific to attrs and appears to be a legacy behavior. Instead of
611
- supporting this in the new standard, we recommend that the maintainers
612
- of attrs move away from the legacy semantics and adopt
613
- ``auto_attribs `` behaviors by default.
614
+ is specific to attrs.
614
615
615
616
Django does not support declaring fields using type annotations only,
616
617
so Django users who leverage ``dataclass_transform `` should be aware
@@ -621,8 +622,8 @@ that they should always supply assigned values.
621
622
622
623
The attrs library supports a bool parameter ``cmp `` that is equivalent
623
624
to setting both ``eq `` and ``order `` to True. We chose not to support
624
- a ``cmp `` parameter, since it only applies to attrs. Attrs users
625
- should use the dataclass-standard ``eq `` and ``order `` parameter names
625
+ a ``cmp `` parameter, since it only applies to attrs. Users can emulate
626
+ the `` cmp `` behaviour by using the ``eq `` and ``order `` parameter names
626
627
instead.
627
628
628
629
Automatic field name aliasing
@@ -682,9 +683,9 @@ Class-wide default values
682
683
-------------------------
683
684
684
685
SQLAlchemy requested that we expose a way to specify that the default
685
- value of all fields in the transformed class is None. It is typical
686
- that all of their fields are optional, and None indicates that the
687
- field is not set.
686
+ value of all fields in the transformed class is `` None `` . It is typical
687
+ that all SQLAlchemy fields are optional, and `` None `` indicates that
688
+ the field is not set.
688
689
689
690
We chose not to support this feature, since it is specific to
690
691
SQLAlchemy. Users can manually set ``default=None `` on these fields
@@ -729,9 +730,6 @@ solution would be to add support for a ``converter`` field specifier
729
730
parameter but then use the ``Any `` type for the corresponding
730
731
parameter in the ``__init__ `` method.
731
732
732
- We chose not to support this feature and recommend that attrs users
733
- avoid converters.
734
-
735
733
736
734
References
737
735
==========
0 commit comments