diff --git a/debugger_protocol/arg/__init__.py b/debugger_protocol/arg/__init__.py new file mode 100644 index 00000000..fc4abbf4 --- /dev/null +++ b/debugger_protocol/arg/__init__.py @@ -0,0 +1 @@ +from ._common import NOT_SET, ANY # noqa diff --git a/debugger_protocol/arg/_common.py b/debugger_protocol/arg/_common.py new file mode 100644 index 00000000..c36af8e7 --- /dev/null +++ b/debugger_protocol/arg/_common.py @@ -0,0 +1,17 @@ + +def sentinel(name): + """Return a named value to use as a sentinel.""" + class Sentinel(object): + def __repr__(self): + return name + + return Sentinel() + + +# NOT_SET indicates that an arg was not provided. +NOT_SET = sentinel('NOT_SET') + +# ANY is a datatype surrogate indicating that any value is okay. +ANY = sentinel('ANY') + +SIMPLE_TYPES = {None, bool, int, str}