MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / fget

Method fget

lib/sqlalchemy/ext/indexable.py:321–331  ·  view source on GitHub ↗
(self, instance: Any, /)

Source from the content-addressed store, hash-verified

319 return self.default
320
321 def fget(self, instance: Any, /) -> _T:
322 attr_name = self.attr_name
323 column_value = getattr(instance, attr_name)
324 if column_value is None:
325 return self._fget_default()
326 try:
327 value = column_value[self.index]
328 except (KeyError, IndexError) as err:
329 return self._fget_default(err)
330 else:
331 return value # type: ignore[no-any-return]
332
333 def fset(self, instance: Any, value: _T) -> None:
334 attr_name = self.attr_name

Callers 7

_copy_internalsMethod · 0.45
__get__Method · 0.45
__get__Method · 0.45
__get__Method · 0.45
__get__Method · 0.45
__get__Method · 0.45
__get__Method · 0.45

Calls 1

_fget_defaultMethod · 0.95

Tested by

no test coverage detected