docstring and comment about get() vs _missing_()

This commit is contained in:
Dave Lassalle
2018-08-29 21:51:52 +01:00
committed by ikelos
parent 0d12a6dbf3
commit c7e0ff9fa0
@@ -26,13 +26,16 @@ class RegValueTypes(enum.Enum):
REG_QWORD = 11
REG_UNKNOWN = 99999
# TODO: Uncomment once we target python-3.6
# TODO: This _missing_() method can replace the get() method below
# if support for Python 3.6 is added in the future
# @classmethod
# def _missing_(cls, value):
# return cls(RegValueTypes.REG_UNKNOWN)
@classmethod
def get(cls, value):
"""An alternative method for using this enum when the value may be unknown.
This is used to support unknown value requests in Python <3.6."""
try:
return cls(value)
except ValueError: