Skip to content

Commit

Permalink
Fix commons type hints
Browse files Browse the repository at this point in the history
  • Loading branch information
bonjourmauko committed Sep 13, 2022
1 parent 1020c25 commit bf6cbb9
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
7 changes: 5 additions & 2 deletions openfisca_core/commons/imports.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
from types import ModuleType
from typing import Tuple

import importlib
import os
import traceback
Expand All @@ -8,7 +11,7 @@
from openfisca_core.warnings import LibYAMLWarning


def import_country_package(country_package_name):
def import_country_package(country_package_name: str) -> ModuleType:
"""Import a country package."""

try:
Expand All @@ -27,7 +30,7 @@ def import_country_package(country_package_name):
raise ImportError(message) from error


def import_yaml():
def import_yaml() -> Tuple[ModuleType, yaml.cyaml.CLoader]:
"""Import the yaml library."""

try:
Expand Down
2 changes: 1 addition & 1 deletion openfisca_core/indexed_enums/enum.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def __init__(self, name: str) -> None:
# When the enum item is initialized, self._member_names_ contains the
# names of the previously initialized items, so its length is the index
# of this item.
self.index = len(self._member_names_)
self.index = len(self._member_names_) # type: ignore

# Bypass the slow Enum.__eq__
__eq__ = object.__eq__
Expand Down
1 change: 0 additions & 1 deletion openfisca_core/tracers/trace_node.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
import numpy

from openfisca_core.indexed_enums import EnumArray
from openfisca_core.periods import Period

Array = typing.Union[EnumArray, numpy.typing.ArrayLike]
Time = typing.Union[float, int]
Expand Down

0 comments on commit bf6cbb9

Please sign in to comment.