MCPcopy Create free account
hub / github.com/sqlalchemy/sqlalchemy / _asdict

Method _asdict

lib/sqlalchemy/engine/row.py:265–280  ·  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

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

Callers 7

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 7

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