Unverified Commit ee222dfb authored by Frank Lee's avatar Frank Lee Committed by GitHub
Browse files

[usability] added assertion message in registry (#864)

parent f0e65455
......@@ -35,7 +35,7 @@ class Registry:
AssertionError: Raises an AssertionError if the module has already been registered before.
"""
module_name = module_class.__name__
assert module_name not in self._registry
assert module_name not in self._registry, f"{module_name} not found in {self.name}"
self._registry[module_name] = module_class
# return so as to use it normally if via importing
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment