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

pull/867/head
Frank Lee 3 years ago committed by GitHub
parent f0e654558f
commit ee222dfbf3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -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

Loading…
Cancel
Save