def get(self, key: Hashable) -> Any:
"""
Retrieves the value stored in the registry based on the `key` provided.
Args:
key: The key used to retrieve the stored object in the registry
Returns:
The object stored in the registry based on the `key` parameter
Raises:
RegistryKeyError: If the key was not found in the registry
"""
if key not in self._registry:
raise RegistryKeyError("Specified key: {} is not in the registry".format(key))
return self._registry[key]
评论列表
文章目录