mirror of
https://github.com/volatilityfoundation/volatility3.git
synced 2026-09-28 20:44:52 +02:00
Add in more interfaces (and fix additional errors now that type information is available).
This commit is contained in:
@@ -15,8 +15,10 @@ class ValidityRoutines(object):
|
||||
These are currently implemented by assertions that will be optimized out of production code.
|
||||
"""
|
||||
|
||||
V = typing.TypeVar('V')
|
||||
|
||||
@classmethod
|
||||
def _check_type(cls, value, valid_type):
|
||||
def _check_type(cls, value: V, valid_type: typing.Type) -> V:
|
||||
"""Checks that value is an instance of valid_type, and returns value if it is, or throws a TypeError otherwise
|
||||
|
||||
:param value: The value of which to validate the type
|
||||
@@ -30,7 +32,7 @@ class ValidityRoutines(object):
|
||||
return value
|
||||
|
||||
@classmethod
|
||||
def _check_class(cls, klass, valid_class):
|
||||
def _check_class(cls, klass: typing.Type, valid_class: typing.Type) -> typing.Type:
|
||||
"""Checks that class is an instance of valid_class, and returns klass if it is, or throws a TypeError otherwise
|
||||
|
||||
:param klass: Class to validate
|
||||
|
||||
Reference in New Issue
Block a user