mirror of
https://github.com/volatilityfoundation/volatility3.git
synced 2026-08-30 19:59:46 +02:00
docstring and comment about get() vs _missing_()
This commit is contained in:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user