generated from jCloud/repository-template
chore: lint source code using Ruff
This commit is contained in:
35 files changed
+161
-130
No files matched your search
@@ -13,13 +13,15 @@
|
||||
# limitations under the License.
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import TypeAlias, Union
|
||||
|
||||
from ...exceptions import (
|
||||
InvalidNamespaceError,
|
||||
NamespaceNotFoundError,
|
||||
NamespaceExistsError,
|
||||
NamespaceNotFoundError,
|
||||
)
|
||||
from ...utils import assert_that_is_instance
|
||||
from typing import Union, TypeAlias, Dict, List
|
||||
|
||||
__all__ = [
|
||||
'PythonNamespace',
|
||||
@@ -51,7 +53,7 @@ class PythonNamespace:
|
||||
return f'{type(self).__name__}({self.name!r})'
|
||||
|
||||
|
||||
PythonPackageNamespaceDictType: TypeAlias = Dict[
|
||||
PythonPackageNamespaceDictType: TypeAlias = dict[
|
||||
str,
|
||||
Union[
|
||||
str,
|
||||
@@ -73,7 +75,7 @@ class PythonPackageNamespace(PythonNamespace):
|
||||
def __init__(
|
||||
self,
|
||||
name: str,
|
||||
sub_namespaces: List[PythonNamespace],
|
||||
sub_namespaces: list[PythonNamespace],
|
||||
) -> None:
|
||||
assert_that_is_instance(sub_namespaces, list)
|
||||
|
||||
@@ -81,7 +83,7 @@ class PythonPackageNamespace(PythonNamespace):
|
||||
|
||||
self._sub_namespaces = sub_namespaces
|
||||
|
||||
def namespace(self, sub_namespaces: List[str]) -> PythonNamespace:
|
||||
def namespace(self, sub_namespaces: list[str]) -> PythonNamespace:
|
||||
"""
|
||||
Returns the namespace object with a specific identifier, such as
|
||||
``['package', 'subpackage', 'module']``.
|
||||
@@ -205,7 +207,7 @@ class PythonPackageNamespace(PythonNamespace):
|
||||
self._sub_namespaces.append(namespace)
|
||||
|
||||
@property
|
||||
def sub_namespaces(self) -> List[PythonNamespace]:
|
||||
def sub_namespaces(self) -> list[PythonNamespace]:
|
||||
return self._sub_namespaces
|
||||
|
||||
|
||||
|
||||
Reference in new issue
Block a user