MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / count_from_n_factory

Function count_from_n_factory

lib/sqlalchemy/ext/orderinglist.py:218–228  ·  view source on GitHub ↗

Numbering function: consecutive integers starting at arbitrary start.

(start: int)

Source from the content-addressed store, hash-verified

216
217
218def count_from_n_factory(start: int) -> OrderingFunc[Any]:
219 """Numbering function: consecutive integers starting at arbitrary start."""
220
221 def f(index: int, collection: object) -> int:
222 return index + start
223
224 try:
225 f.__name__ = "count_from_%i" % start
226 except TypeError:
227 pass
228 return f
229
230
231def _unsugar_count_from(**kw: Any) -> Dict[str, Any]:

Callers 1

_unsugar_count_fromFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected