features: use ABC to denote abstract classes

This commit is contained in:
Willi Ballenthin
2022-04-04 11:49:51 -06:00
parent 85b1d50945
commit 2989af0a3f
2 changed files with 5 additions and 2 deletions

View File

@@ -7,6 +7,7 @@
# See the License for the specific language governing permissions and limitations under the License.
import re
import abc
import codecs
import logging
import collections
@@ -96,7 +97,7 @@ class Result:
return self.success
class Feature:
class Feature(abc.ABC):
def __init__(self, value: Union[str, int, bytes], bitness=None, description=None):
"""
Args:

View File

@@ -5,6 +5,8 @@
# Unless required by applicable law or agreed to in writing, software distributed under the License
# is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and limitations under the License.
import abc
import capa.render.utils
from capa.features.common import Feature
@@ -43,7 +45,7 @@ class Mnemonic(Feature):
MAX_OPERAND_INDEX = 3
class _Operand(Feature):
class _Operand(Feature, abc.ABC):
# superclass: don't use directly
# subclasses should set self.name and provide the value string formatter
def __init__(self, index: int, value: int, description=None):