diff --git a/openfisca_core/indexed_enums/enum.py b/openfisca_core/indexed_enums/enum.py index 6cea7a383d..b3f5dc6c76 100644 --- a/openfisca_core/indexed_enums/enum.py +++ b/openfisca_core/indexed_enums/enum.py @@ -1,7 +1,7 @@ from __future__ import annotations import enum -from typing import Any, Union +from typing import Any, List, Union import numpy @@ -227,6 +227,9 @@ def encode(cls, array: A) -> EnumArray: """ + conditions: List[ArrayType[bool]] + choices: List[int] + if isinstance(array, EnumArray): return array diff --git a/openfisca_core/indexed_enums/enum_array.py b/openfisca_core/indexed_enums/enum_array.py index c480c2dae9..ca118cb119 100644 --- a/openfisca_core/indexed_enums/enum_array.py +++ b/openfisca_core/indexed_enums/enum_array.py @@ -76,6 +76,7 @@ def __new__( ) -> EnumArray: """See comment above.""" + obj: EnumArray obj = numpy.asarray(input_array).view(cls) obj.possible_values = possible_values return obj