Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit30117a3

Browse files
nejchJohnVillalovos
authored andcommitted
chore: use dataclass for RequiredOptional
1 parent271cfd3 commit30117a3

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
importimportlib
1919
importpprint
2020
importtextwrap
21+
fromdataclassesimportdataclass
2122
fromtypesimportModuleType
22-
fromtypingimportAny,Dict,Iterable,NamedTuple,Optional,Tuple,Type,Union
23+
fromtypingimportAny,Dict,Iterable,Optional,Tuple,Type,Union
2324

2425
importgitlab
2526
fromgitlabimporttypesasg_types
@@ -316,7 +317,8 @@ def total(self) -> Optional[int]:
316317
returnself._list.total
317318

318319

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

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp