@@ -47,22 +47,20 @@ class Field:
4747 way the decorator understands.
4848 """
4949
50- __slots__ = ("default_factory" , "init" , "kw_only" , "name" , "repr" )
50+ __slots__ = ("default_factory" , "init" , "kw_only" , "name" )
5151
5252 def __init__ (
5353 self ,
5454 * ,
5555 name : str | None = None ,
5656 default_factory : Callable [[], _FieldValue ] | _MISSING_TYPE = MISSING ,
5757 init : bool = True ,
58- repr : bool = True ,
5958 kw_only : bool | _MISSING_TYPE = MISSING ,
6059 ) -> None :
6160 """Do not call directly; use :func:`field` instead."""
6261 self .name = name
6362 self .default_factory = default_factory
6463 self .init = init
65- self .repr = repr
6664 self .kw_only = kw_only
6765
6866
@@ -71,7 +69,6 @@ def field(
7169 default : _FieldValue | _MISSING_TYPE = MISSING ,
7270 default_factory : Callable [[], _FieldValue ] | _MISSING_TYPE = MISSING ,
7371 init : bool = True ,
74- repr : bool = True ,
7572 kw_only : bool | _MISSING_TYPE = MISSING ,
7673) -> _FieldValue :
7774 """(Experimental) Declare a dataclass-style field on a :func:`c_class` proxy.
@@ -94,9 +91,6 @@ def field(
9491 init
9592 If ``True`` the field is included in the generated ``__init__``.
9693 If ``False`` the field is omitted from input arguments of ``__init__``.
97- repr
98- If ``True`` the field is included in the generated ``__repr__``.
99- If ``False`` the field is omitted from the ``__repr__`` output.
10094 kw_only
10195 If ``True``, the field is a keyword-only argument in ``__init__``.
10296 If ``MISSING``, inherits from the class-level ``kw_only`` setting or
@@ -158,13 +152,11 @@ class PyBase:
158152 raise ValueError ("Cannot specify both `default` and `default_factory`" )
159153 if not isinstance (init , bool ):
160154 raise TypeError ("`init` must be a bool" )
161- if not isinstance (repr , bool ):
162- raise TypeError ("`repr` must be a bool" )
163155 if kw_only is not MISSING and not isinstance (kw_only , bool ):
164156 raise TypeError (f"`kw_only` must be a bool, got { type (kw_only ).__name__ !r} " )
165157 if default is not MISSING :
166158 default_factory = _make_default_factory (default )
167- ret = Field (default_factory = default_factory , init = init , repr = repr , kw_only = kw_only )
159+ ret = Field (default_factory = default_factory , init = init , kw_only = kw_only )
168160 return cast (_FieldValue , ret )
169161
170162
0 commit comments