10000 chore: use dataclass for RequiredOptional · python-gitlab/python-gitlab@30117a3 · GitHub
[go: up one dir, main page]

Skip to content

Commit 30117a3

Browse files
nejchJohnVillalovos
authored andcommitted
chore: use dataclass for RequiredOptional
1 parent 271cfd3 commit 30117a3

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

gitlab/base.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,9 @@
1818
import importlib
1919
import pprint
2020
import textwrap
21+
from dataclasses import dataclass
2122
from types import ModuleType
22-
from typing import Any, Dict, Iterable, NamedTuple, Optional, Tuple, Type, Union
23+
from typing import Any, Dict, Iterable, Optional, Tuple, Type, Union
2324

2425
import gitlab
2526
from gitlab import types as g_types
@@ -316,7 +317,8 @@ def total(self) -> Optional[int]:
316317
return self._list.total
317318

318319

319-
class RequiredOptional(NamedTuple):
320+
@dataclass(frozen=True)
321+
class RequiredOptional:
320322
required: Tuple[str, ...] = ()
321323
optional: Tuple[str, ...] = ()
322324

0 commit comments

Comments
 (0)
0