@@ -221,6 +221,7 @@ customization of default behaviors:
221
221
order_default : bool = False ,
222
222
kw_only_default : bool = False ,
223
223
field_specifiers : tuple[type | Callable[... , Any], ... ] = (),
224
+ ** kwargs : Any,
224
225
) -> Callable[[_T], _T]: ...
225
226
226
227
* ``eq_default `` indicates whether the ``eq `` parameter is assumed to
@@ -245,6 +246,11 @@ customization of default behaviors:
245
246
function (``field ``) that instantiates this class, so if we were
246
247
describing the stdlib dataclass behavior, we would provide the
247
248
tuple argument ``(dataclasses.Field, dataclasses.field) ``.
249
+ * ``kwargs `` allows arbitrary additional keyword args to be passed to
250
+ ``dataclass_transform ``. This gives type checkers the freedom to
251
+ support experimental parameters without needing to wait for changes
252
+ in ``typing.py ``. Type checkers should report errors for any
253
+ unrecognized parameters.
248
254
249
255
In the future, we may add additional parameters to
250
256
``dataclass_transform `` as needed to support common behaviors in user
@@ -465,10 +471,10 @@ Runtime behavior
465
471
----------------
466
472
467
473
At runtime, the ``dataclass_transform `` decorator's only effect is to
468
- set a string attribute named ``__dataclass_transform__ `` on the
469
- decorated function or class to support introspection. The value of the
470
- attribute should be a dict mapping the names of the
471
- `` dataclass_transform `` parameters to their values.
474
+ set an attribute named ``__dataclass_transform__ `` on the decorated
475
+ function or class to support introspection. The value of the attribute
476
+ should be a dict mapping the names of the `` dataclass_transform ``
477
+ parameters to their values.
472
478
473
479
For example:
474
480
@@ -479,6 +485,7 @@ For example:
479
485
" order_default" : False ,
480
486
" kw_only_default" : False ,
481
487
" field_specifiers" : (),
488
+ " kwargs" : {}
482
489
}
483
490
484
491
0 commit comments