mirror of
https://github.com/python/cpython.git
synced 2025-10-09 16:34:44 +00:00
gh-99957: Add frozen_default
parameter on dataclass_transform
(#99958)
This commit is contained in:
parent
bed15f87ea
commit
5c19050546
4 changed files with 13 additions and 1 deletions
|
@ -3363,6 +3363,7 @@ def dataclass_transform(
|
|||
eq_default: bool = True,
|
||||
order_default: bool = False,
|
||||
kw_only_default: bool = False,
|
||||
frozen_default: bool = False,
|
||||
field_specifiers: tuple[type[Any] | Callable[..., Any], ...] = (),
|
||||
**kwargs: Any,
|
||||
) -> Callable[[T], T]:
|
||||
|
@ -3416,6 +3417,8 @@ def dataclass_transform(
|
|||
assumed to be True or False if it is omitted by the caller.
|
||||
- ``kw_only_default`` indicates whether the ``kw_only`` parameter is
|
||||
assumed to be True or False if it is omitted by the caller.
|
||||
- ``frozen_default`` indicates whether the ``frozen`` parameter is
|
||||
assumed to be True or False if it is omitted by the caller.
|
||||
- ``field_specifiers`` specifies a static list of supported classes
|
||||
or functions that describe fields, similar to ``dataclasses.field()``.
|
||||
- Arbitrary other keyword arguments are accepted in order to allow for
|
||||
|
@ -3432,6 +3435,7 @@ def dataclass_transform(
|
|||
"eq_default": eq_default,
|
||||
"order_default": order_default,
|
||||
"kw_only_default": kw_only_default,
|
||||
"frozen_default": frozen_default,
|
||||
"field_specifiers": field_specifiers,
|
||||
"kwargs": kwargs,
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue