MCPcopy
hub / github.com/psycopg/psycopg / _get_method

Method _get_method

tests/fix_faker.py:284–294  ·  view source on GitHub ↗
(self, prefix, cls)

Source from the content-addressed store, hash-verified

282 return meth if meth else self.match_any
283
284 def _get_method(self, prefix, cls):
285 name = cls.__name__
286 if cls.__module__ != "builtins":
287 name = f"{cls.__module__}.{name}"
288
289 parts = name.split(".")
290 for i in range(len(parts) - 1, -1, -1):
291 if meth := getattr(self, f"{prefix}_{'_'.join(parts[-(i + 1):])}", None):
292 return meth
293
294 return None
295
296 def make(self, spec):
297 # spec can be a type or a tuple (type, options)

Callers 4

make_schemaMethod · 0.95
get_makerMethod · 0.95
get_matcherMethod · 0.95
exampleMethod · 0.95

Calls 1

joinMethod · 0.45

Tested by

no test coverage detected