MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / __getitem__

Method __getitem__

lib/sqlalchemy/sql/lambdas.py:1406–1417  ·  view source on GitHub ↗
(self, key)

Source from the content-addressed store, hash-verified

1404 return iter(elem)
1405
1406 def __getitem__(self, key):
1407 elem = object.__getattribute__(self, "_to_evaluate")
1408 if not hasattr(elem, "__getitem__"):
1409 raise AttributeError("__getitem__")
1410
1411 if isinstance(key, PyWrapper):
1412 # TODO: coverage
1413 raise exc.InvalidRequestError(
1414 "Dictionary keys / list indexes inside of a cached "
1415 "lambda must be Python literals only"
1416 )
1417 return self._sa__add_getter(key, operator.itemgetter)
1418
1419 def _add_getter(self, key, getter_fn):
1420 bind_paths = object.__getattribute__(self, "_bind_paths")

Callers

nothing calls this directly

Calls 1

__getattribute__Method · 0.45

Tested by

no test coverage detected