MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / _asdict

Method _asdict

lib/sqlalchemy/engine/row.py:268–283  ·  view source on GitHub ↗

Return a new dict which maps field names to their corresponding values. This method is analogous to the Python named tuple ``._asdict()`` method, and works by applying the ``dict()`` constructor to the :attr:`.Row._mapping` attribute. .. versionadded:: 1.4

(self)

Source from the content-addressed store, hash-verified

266 return tuple([k for k in self._parent.keys if k is not None])
267
268 def _asdict(self) -> Dict[str, Any]:
269 """Return a new dict which maps field names to their corresponding
270 values.
271
272 This method is analogous to the Python named tuple ``._asdict()``
273 method, and works by applying the ``dict()`` constructor to the
274 :attr:`.Row._mapping` attribute.
275
276 .. versionadded:: 1.4
277
278 .. seealso::
279
280 :attr:`.Row._mapping`
281
282 """
283 return dict(self._mapping)
284
285
286BaseRowProxy = BaseRow

Callers 8

test_ro_mapping_py3kMethod · 0.80
test_emptyMethod · 0.80
test_creationMethod · 0.80
test_none_labelMethod · 0.80
test_duplicate_labelsMethod · 0.80
test_serializeMethod · 0.80

Calls

no outgoing calls

Tested by 8

test_ro_mapping_py3kMethod · 0.64
test_emptyMethod · 0.64
test_creationMethod · 0.64
test_none_labelMethod · 0.64
test_duplicate_labelsMethod · 0.64
test_serializeMethod · 0.64