MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / __getattr__

Method __getattr__

lib/sqlalchemy/sql/functions.py:996–1008  ·  view source on GitHub ↗
(self, name: str)

Source from the content-addressed store, hash-verified

994 self.opts = opts
995
996 def __getattr__(self, name: str) -> _FunctionGenerator:
997 # passthru __ attributes; fixes pydoc
998 if name.startswith("__"):
999 try:
1000 return self.__dict__[name] # type: ignore
1001 except KeyError:
1002 raise AttributeError(name)
1003
1004 elif name.endswith("_"):
1005 name = name[0:-1]
1006 f = _FunctionGenerator(**self.opts)
1007 f.__names = list(self.__names) + [name]
1008 return f
1009
1010 @overload
1011 def __call__(

Callers

nothing calls this directly

Calls 3

_FunctionGeneratorClass · 0.85
startswithMethod · 0.45
endswithMethod · 0.45

Tested by

no test coverage detected