Home
last modified time | relevance | path

Searched refs:default_factory (Results 1 – 18 of 18) sorted by relevance

/external/python/cpython3/Lib/test/
Dtest_defaultdict.py18 self.assertEqual(d1.default_factory, None)
19 d1.default_factory = list
29 self.assertEqual(d2.default_factory, list)
42 d2.default_factory = None
43 self.assertEqual(d2.default_factory, None)
55 d1.default_factory = list
60 self.assertEqual(d1.default_factory, None)
66 self.assertEqual(d2.default_factory, int)
71 self.assertTrue(d3.default_factory is foo)
100 self.assertEqual(d2.default_factory, None)
[all …]
Dtest_dataclasses.py828 x: int=field(default_factory=MISSING)
837 x: int=field(default=MISSING, default_factory=MISSING)
1013 x: ClassVar[int] = field(default_factory=int)
1071 x: InitVar[int] = field(default_factory=int)
1131 y: list = field(default_factory=list)
1146 y: list = field(default_factory=lambda: l)
1160 x: list = field(default_factory=list, repr=False)
1167 x: list = field(default_factory=list, hash=False)
1174 x: list = field(default_factory=list, init=False)
1180 x: list = field(default_factory=list, compare=False)
[all …]
Dtest_sys.py971 check(collections.defaultdict.default_factory, size('3PP'))
/external/python/cpython2/Lib/test/
Dtest_defaultdict.py18 self.assertEqual(d1.default_factory, None)
19 d1.default_factory = list
29 self.assertEqual(d2.default_factory, list)
42 d2.default_factory = None
43 self.assertEqual(d2.default_factory, None)
55 d1.default_factory = list
60 self.assertEqual(d1.default_factory, None)
66 self.assertEqual(d2.default_factory, int)
71 self.assertTrue(d3.default_factory is foo)
100 self.assertEqual(d2.default_factory, None)
[all …]
/external/python/cpython3/Lib/
Ddataclasses.py233 def __init__(self, default, default_factory, init, repr, hash, compare, argument
238 self.default_factory = default_factory
309 def field(*, default=MISSING, default_factory=MISSING, init=True, repr=True, argument
325 if default is not MISSING and default_factory is not MISSING:
327 return Field(default, default_factory, init, repr, hash, compare,
407 if f.default_factory is not MISSING:
411 globals[default_name] = f.default_factory
430 globals[default_name] = f.default_factory
461 if f.default is MISSING and f.default_factory is MISSING:
469 elif f.default_factory is not MISSING:
[all …]
Dpprint.py411 rdf = self._repr(object.default_factory, context, level)
/external/python/cpython2/Modules/
D_collectionsmodule.c1451 PyObject *default_factory; member
1466 PyObject *factory = dd->default_factory; in defdict_missing()
1497 if (dd->default_factory == NULL) in defdict_copy()
1500 dd->default_factory, dd, NULL); in defdict_copy()
1531 if (dd->default_factory == NULL || dd->default_factory == Py_None) in defdict_reduce()
1534 args = PyTuple_Pack(1, dd->default_factory); in defdict_reduce()
1563 offsetof(defdictobject, default_factory), 0,
1573 Py_CLEAR(dd->default_factory); in defdict_dealloc()
1584 if (dd->default_factory == NULL) { in defdict_print()
1589 PyObject_Print(dd->default_factory, fp, 0); in defdict_print()
[all …]
/external/tensorflow/tensorflow/python/data/experimental/ops/
Dstats_options.py57 default_factory=lambda: "")
63 default_factory=lambda: "")
/external/tensorflow/tensorflow/python/data/util/
Doptions.py59 def create_option(name, ty, docstring, default_factory=lambda: None): argument
77 option._options[name] = default_factory()
Doptions_test.py30 default_factory=lambda: 42)
32 name="y", ty=float, docstring="a tasty pie", default_factory=lambda: 3.14)
/external/python/cpython3/Modules/
D_collectionsmodule.c1975 PyObject *default_factory; member
1990 PyObject *factory = dd->default_factory; in defdict_missing()
2021 if (dd->default_factory == NULL) in defdict_copy()
2024 dd->default_factory, dd, NULL); in defdict_copy()
2058 if (dd->default_factory == NULL || dd->default_factory == Py_None) in defdict_reduce()
2061 args = PyTuple_Pack(1, dd->default_factory); in defdict_reduce()
2097 offsetof(defdictobject, default_factory), 0,
2107 Py_CLEAR(dd->default_factory); in defdict_dealloc()
2120 if (dd->default_factory == NULL) in defdict_repr()
2124 int status = Py_ReprEnter(dd->default_factory); in defdict_repr()
[all …]
/external/python/cpython3/Doc/library/
Ddataclasses.rst179 .. function:: field(*, default=MISSING, default_factory=MISSING, repr=True, hash=None, init=True, c…
189 mylist: List[int] = field(default_factory=list)
195 detect if the ``default`` and ``default_factory`` parameters are
206 - ``default_factory``: If provided, it must be a zero-argument
210 error to specify both ``default`` and ``default_factory``.
274 - ``default``, ``default_factory``, ``init``, ``repr``, ``hash``,
515 If a :func:`field` specifies a ``default_factory``, it is called with
519 mylist: list = field(default_factory=list)
522 and the field also specifies ``default_factory``, then the default
582 x: list = field(default_factory=list)
Dcollections.rst680 .. class:: defaultdict([default_factory[, ...]])
687 The first argument provides the initial value for the :attr:`default_factory`
698 If the :attr:`default_factory` attribute is ``None``, this raises a
701 If :attr:`default_factory` is not ``None``, it is called without arguments
705 If calling :attr:`default_factory` raises an exception this exception is
715 :attr:`default_factory`.
721 .. attribute:: default_factory
731 Using :class:`list` as the :attr:`~defaultdict.default_factory`, it is easy to group a
743 mapping; so an entry is automatically created using the :attr:`~defaultdict.default_factory`
757 Setting the :attr:`~defaultdict.default_factory` to :class:`int` makes the
[all …]
/external/python/cpython2/Doc/library/
Dcollections.rst443 .. class:: defaultdict([default_factory[, ...]])
450 The first argument provides the initial value for the :attr:`default_factory`
462 If the :attr:`default_factory` attribute is ``None``, this raises a
465 If :attr:`default_factory` is not ``None``, it is called without arguments
469 If calling :attr:`default_factory` raises an exception this exception is
479 :attr:`default_factory`.
485 .. attribute:: default_factory
495 Using :class:`list` as the :attr:`default_factory`, it is easy to group a
507 mapping; so an entry is automatically created using the :attr:`default_factory`
521 Setting the :attr:`default_factory` to :class:`int` makes the
[all …]
/external/tensorflow/tensorflow/python/data/ops/
Ddataset_ops.py1979 default_factory=optimization_options.OptimizationOptions)
1987 default_factory=stats_options.StatsOptions)
1995 default_factory=threading_options.ThreadingOptions)
/external/python/cpython3/Misc/NEWS.d/
D3.7.0b3.rst190 default_factory would generate an incorrect class.
/external/python/cpython2/Misc/NEWS.d/
D2.6a1.rst128 collections.defaultdict, if its default_factory is set to a bound method.
/external/python/cpython3/Misc/
DHISTORY16942 subclass of collections.defaultdict, if its default_factory is set