From 99c18cd6c244d12c3240c13c70422684572154d2 Mon Sep 17 00:00:00 2001 From: Roman Mogylatov Date: Sat, 23 Jul 2022 23:03:35 -0400 Subject: [PATCH] Rename properties of PatchedRegistry --- src/dependency_injector/wiring.py | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/dependency_injector/wiring.py b/src/dependency_injector/wiring.py index ba72039e..f7fd7b61 100644 --- a/src/dependency_injector/wiring.py +++ b/src/dependency_injector/wiring.py @@ -92,38 +92,38 @@ Container = Any class PatchedRegistry: def __init__(self): - self._patched_callables: Dict[Callable[..., Any], "PatchedCallable"] = {} - self._patched_attributes: Set[PatchedAttribute] = set() + self._callables: Dict[Callable[..., Any], "PatchedCallable"] = {} + self._attributes: Set[PatchedAttribute] = set() def register_callable(self, patched: "PatchedCallable") -> None: - self._patched_callables[patched.patched] = patched + self._callables[patched.patched] = patched def get_callables_from_module(self, module: ModuleType) -> Iterator[Callable[..., Any]]: - for patched_callable in self._patched_callables.values(): + for patched_callable in self._callables.values(): if not patched_callable.is_in_module(module): continue yield patched_callable.patched def get_callable(self, fn: Callable[..., Any]) -> "PatchedCallable": - return self._patched_callables.get(fn) + return self._callables.get(fn) def has_callable(self, fn: Callable[..., Any]) -> bool: - return fn in self._patched_callables + return fn in self._callables def register_attribute(self, patched: "PatchedAttribute"): - self._patched_attributes.add(patched) + self._attributes.add(patched) def get_attributes_from_module(self, module: ModuleType) -> Iterator["PatchedAttribute"]: - for attribute in self._patched_attributes: + for attribute in self._attributes: if not attribute.is_in_module(module): continue yield attribute def clear_module_attributes(self, module: ModuleType): - for attribute in self._patched_attributes.copy(): + for attribute in self._attributes.copy(): if not attribute.is_in_module(module): continue - self._patched_attributes.remove(attribute) + self._attributes.remove(attribute) class PatchedCallable: