MCPcopy Index your code
hub / github.com/faif/python-patterns / __init__

Method __init__

patterns/structural/adapter.py:77–80  ·  view source on GitHub ↗

We set the adapted methods in the object's dict.

(self, obj: T, **adapted_methods: Callable[..., Any])

Source from the content-addressed store, hash-verified

75 """
76
77 def __init__(self, obj: T, **adapted_methods: Callable[..., Any]) -> None:
78 """We set the adapted methods in the object's dict."""
79 self.obj = obj
80 self.__dict__.update(adapted_methods)
81
82 def __getattr__(self, attr: str) -> Any:
83 """All non-adapted calls are passed to the object."""

Callers

nothing calls this directly

Calls 1

updateMethod · 0.45

Tested by

no test coverage detected