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

Method __getattr__

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

Source from the content-addressed store, hash-verified

953 self.opts = opts
954
955 def __getattr__(self, name: str) -> _FunctionGenerator:
956 # passthru __ attributes; fixes pydoc
957 if name.startswith("__"):
958 try:
959 return self.__dict__[name] # type: ignore
960 except KeyError:
961 raise AttributeError(name)
962
963 elif name.endswith("_"):
964 name = name[0:-1]
965 f = _FunctionGenerator(**self.opts)
966 f.__names = list(self.__names) + [name]
967 return f
968
969 @overload
970 def __call__(

Callers

nothing calls this directly

Calls 3

_FunctionGeneratorClass · 0.85
startswithMethod · 0.45
endswithMethod · 0.45

Tested by

no test coverage detected