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

Method __getitem__

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

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 1

__getattribute__Method · 0.45

Tested by

no test coverage detected