MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / tuplegetter

Function tuplegetter

lib/sqlalchemy/engine/_util_cy.py:129–136  ·  view source on GitHub ↗
(*indexes: int)

Source from the content-addressed store, hash-verified

127
128
129def tuplegetter(*indexes: int) -> _TupleGetterType:
130 max_index: int
131 if len(indexes) == 1 or _is_contiguous(indexes):
132 # slice form is faster but returns a list if input is list
133 max_index = indexes[-1]
134 return operator.itemgetter(slice(indexes[0], max_index + 1))
135 else:
136 return operator.itemgetter(*indexes)

Callers 5

_row_as_tuple_getterMethod · 0.85
__setstate__Method · 0.85
_reduceMethod · 0.85
_reduceMethod · 0.85
__setstate__Method · 0.85

Calls 1

_is_contiguousFunction · 0.85

Tested by

no test coverage detected