Lines Matching refs:init
34 # about init=, repr=, eq=, order=, unsafe_hash=, or frozen=, I'm
55 # +--- init= parameter
169 # tuple of __init__ parameter names; non-init fields must be matched by keyword.
280 'init',
287 def __init__(self, default, default_factory, init, repr, hash, compare,
293 self.init = init
310 f'init={self.init!r},'
338 __slots__ = ('init',
346 def __init__(self, init, repr, eq, order, unsafe_hash, frozen):
347 self.init = init
356 f'init={self.init!r},'
368 def field(*, default=MISSING, default_factory=MISSING, init=True, repr=True,
373 0-argument function called to initialize a field's value. If init
388 return Field(default, default_factory, init, repr, hash, compare,
396 return (tuple(f for f in fields if f.init and not f.kw_only),
397 tuple(f for f in fields if f.init and f.kw_only)
455 if f.init:
481 if f.init:
541 if f.init:
563 # Does this class have a post-init function?
794 # example, how about init=False (or really,
795 # init=<not-the-default-init-value>)? It makes no sense for
796 # ClassVar and InitVar to specify init=<anything>.
884 def _process_class(cls, init, repr, eq, order, unsafe_hash, frozen,
902 setattr(cls, _PARAMS, _DataclassParams(init, repr, eq, order,
1015 # initialized here, outside of the "if init:" test, because std_init_fields
1022 if init:
1023 # Does this class have a post-init function?
1202 def dataclass(cls=None, /, *, init=True, repr=True, eq=True, order=False,
1209 If init is true, an __init__() method is added to the class. If repr
1220 return _process_class(cls, init, repr, eq, order, unsafe_hash,
1379 def make_dataclass(cls_name, fields, *, bases=(), namespace=None, init=True,
1390 C = make_dataclass('C', ['x', ('y', int), ('z', int, field(init=False))], bases=(Base,))
1398 z: int = field(init=False)
1402 The parameters init, repr, eq, order, unsafe_hash, and frozen are passed to
1447 return dataclass(cls, init=init, repr=repr, eq=eq, order=order,
1474 # It's an error to have init=False fields in 'changes'.
1482 if not f.init:
1486 'init=False, it cannot be specified with '
1497 # __post_init__() (if defined), using all of the init fields we've