generated from jCloud/repository-template
Add type checking for the name attribute at the constructor of core.python.namespaces.PythonNamespace
This commit is contained in:
+2
-1
@@ -8,4 +8,5 @@
|
|||||||
- Add function to format a list human-readable
|
- Add function to format a list human-readable
|
||||||
- Add function to assert that an object is an instance of a specific type
|
- Add function to assert that an object is an instance of a specific type
|
||||||
- Add python project documentation generator class
|
- Add python project documentation generator class
|
||||||
- Add python namespaces classes
|
- Add python namespaces classes
|
||||||
|
- Add type checking for the `name` attribute at the constructor of `core.python.namespaces.PythonNamespace`
|
||||||
@@ -13,6 +13,7 @@
|
|||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
|
||||||
from ...exceptions import InvalidNamespaceError, NamespaceNotFoundError
|
from ...exceptions import InvalidNamespaceError, NamespaceNotFoundError
|
||||||
|
from ...utils import assert_that_is_instance
|
||||||
|
|
||||||
__all__ = [
|
__all__ = [
|
||||||
'PythonNamespace',
|
'PythonNamespace',
|
||||||
@@ -28,6 +29,8 @@ class PythonNamespace:
|
|||||||
:type name: str
|
:type name: str
|
||||||
'''
|
'''
|
||||||
def __init__(self, name: str) -> None:
|
def __init__(self, name: str) -> None:
|
||||||
|
assert_that_is_instance(name, str)
|
||||||
|
|
||||||
self.name = name
|
self.name = name
|
||||||
|
|
||||||
class PythonPackageNamespace(PythonNamespace):
|
class PythonPackageNamespace(PythonNamespace):
|
||||||
|
|||||||
Reference in New Issue
Block a user