Skip to content

Commit c7e0fa1

Browse files
committed
renaming
1 parent f51d76f commit c7e0fa1

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

dargs/dargs.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727

2828
INDENT = " " # doc is indented by four spaces
2929
DUMMYHOOK = lambda a,x: None
30-
class Default(Enum): NONE = 1
30+
class _Flag(Enum): NONE = 1
3131

3232
class Argument:
3333

@@ -38,7 +38,7 @@ def __init__(self,
3838
sub_variants: Optional[Iterable["Variant"]] = None,
3939
repeat: bool = False,
4040
optional: bool = False,
41-
default: Any = Default.NONE,
41+
default: Any = _Flag.NONE,
4242
alias: Optional[Iterable[str]] = None,
4343
doc: str = ""):
4444
self.name = name
@@ -73,7 +73,7 @@ def reorg_dtype(self):
7373
# check conner cases
7474
if self.sub_fields or self.sub_variants:
7575
self.dtype.add(list if self.repeat else dict)
76-
if self.optional and self.default is not Default.NONE:
76+
if self.optional and self.default is not _Flag.NONE:
7777
self.dtype.add(type(self.default))
7878
# and make it compatible with `isinstance`
7979
self.dtype = tuple(self.dtype)
@@ -228,7 +228,7 @@ def normalize_value(self, value: Any, inplace: bool = False,
228228
def _assign_default(self, argdict: dict):
229229
if (self.name not in argdict
230230
and self.optional
231-
and self.default is not Default.NONE):
231+
and self.default is not _Flag.NONE):
232232
argdict[self.name] = self.default
233233

234234
def _convert_alias(self, argdict: dict):
@@ -272,7 +272,7 @@ def gen_doc_head(self, paths: Optional[List[str]] = None, **kwargs) -> str:
272272
typesig = "| type: " + " | ".join([f"``{dt.__name__}``" for dt in self.dtype])
273273
if self.optional:
274274
typesig += ", optional"
275-
if self.default is not Default.NONE:
275+
if self.default is not _Flag.NONE:
276276
typesig += f", default: ``{self.default}``"
277277
head = f"{self.name}: \n{indent(typesig, INDENT)}"
278278
if kwargs.get("make_anchor"):

0 commit comments

Comments
 (0)