Typing: Change signatures to co-variant Mapping from Dict

This commit is contained in:
Mike Auty
2019-11-27 11:30:14 +00:00
committed by ikelos
parent d36545d4c0
commit 0e016797bb
2 changed files with 4 additions and 4 deletions
+3 -3
View File
@@ -5,7 +5,7 @@
import bisect
import collections.abc
from abc import abstractmethod, ABC
from typing import Any, Dict, Iterable, List, Optional, Tuple, Type
from typing import Any, Dict, Iterable, List, Optional, Tuple, Type, Mapping
from volatility.framework import constants, exceptions, interfaces
from volatility.framework.interfaces import configuration, objects
@@ -80,7 +80,7 @@ class BaseSymbolTableInterface:
name: str,
native_types: 'NativeTableInterface',
table_mapping: Optional[Dict[str, str]] = None,
class_types: Optional[Dict[str, Type[objects.ObjectInterface]]] = None) -> None:
class_types: Optional[Mapping[str, Type[objects.ObjectInterface]]] = None) -> None:
"""
Args:
@@ -266,7 +266,7 @@ class SymbolTableInterface(BaseSymbolTableInterface, configuration.ConfigurableI
name: str,
native_types: 'NativeTableInterface',
table_mapping: Optional[Dict[str, str]] = None,
class_types: Optional[Dict[str, Type[objects.ObjectInterface]]] = None) -> None:
class_types: Optional[Mapping[str, Type[objects.ObjectInterface]]] = None) -> None:
"""Instantiates an SymbolTable based on an IntermediateSymbolFormat JSON file. This is validated against the
appropriate schema. The validation can be disabled by passing validate = False, but this should almost never be
done.
+1 -1
View File
@@ -83,7 +83,7 @@ class IntermediateSymbolTable(interfaces.symbols.SymbolTableInterface):
native_types: interfaces.symbols.NativeTableInterface = None,
table_mapping: Optional[Dict[str, str]] = None,
validate: bool = True,
class_types: Optional[Dict[str, Type[interfaces.objects.ObjectInterface]]] = None) -> None:
class_types: Optional[Mapping[str, Type[interfaces.objects.ObjectInterface]]] = None) -> None:
"""Instantiates a SymbolTable based on an IntermediateSymbolFormat JSON file. This is validated against the
appropriate schema. The validation can be disabled by passing validate = False, but this should almost never be
done.