summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNejc Habjan <nejc.habjan@siemens.com>2022-01-23 10:28:33 +0100
committerNejc Habjan <nejc.habjan@siemens.com>2022-01-23 10:28:33 +0100
commitb368c227ec246158985725c7bec79b75f2c87b88 (patch)
tree104ab9cf00eced77797f753733168bf196a722fc
parente827bd1d0e4182e5f5c1881913fdac58dc15ca9a (diff)
downloadgitlab-chore/code-review-doctor-findings.tar.gz
chore: use dataclass for RequiredOptionalchore/code-review-doctor-findings
-rw-r--r--gitlab/base.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/gitlab/base.py b/gitlab/base.py
index b6ced89..aa18dcf 100644
--- a/gitlab/base.py
+++ b/gitlab/base.py
@@ -18,8 +18,9 @@
import importlib
import pprint
import textwrap
+from dataclasses import dataclass
from types import ModuleType
-from typing import Any, Dict, Iterable, NamedTuple, Optional, Tuple, Type, Union
+from typing import Any, Dict, Iterable, Optional, Tuple, Type, Union
import gitlab
from gitlab import types as g_types
@@ -316,7 +317,8 @@ class RESTObjectList:
return self._list.total
-class RequiredOptional(NamedTuple):
+@dataclass(frozen=True)
+class RequiredOptional:
required: Tuple[str, ...] = ()
optional: Tuple[str, ...] = ()