Skip to content

Commit f7651d9

Browse files
committed
Fix typing in py3.7
1 parent 1b79d3c commit f7651d9

4 files changed

Lines changed: 12 additions & 6 deletions

File tree

openfisca_core/periods/instant_.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
from __future__ import annotations
22

3-
from typing import Dict, Optional, Union
3+
from typing import Dict, Optional, Tuple, Union
44

55
import calendar
66
import datetime
@@ -9,7 +9,7 @@
99
from ._units import DAY, MONTH, YEAR
1010

1111

12-
class Instant(tuple[int, int, int]):
12+
class Instant(Tuple[int, int, int]):
1313
"""An instant in time (``year``, ``month``, ``day``).
1414
1515
An ``Instant`` represents the most atomic and indivisible

openfisca_core/periods/period_.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
from __future__ import annotations
22

3-
from typing import Optional, Sequence, Union
3+
from typing import Optional, Sequence, Tuple, Union
44

55
import calendar
66
import datetime
@@ -10,7 +10,7 @@
1010
from .instant_ import Instant
1111

1212

13-
class Period(tuple[str, Instant, int]):
13+
class Period(Tuple[str, Instant, int]):
1414
"""Toolbox to handle date intervals.
1515
1616
A ``Period`` is a triple (``unit``, ``start``, ``size``).

openfisca_core/taxbenefitsystems/tax_benefit_system.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -399,10 +399,10 @@ def get_parameters_at_instant(
399399
key: Optional[types.Instant]
400400
msg: str
401401

402-
if isinstance(instant, Instant):
402+
if isinstance(instant, types.Instant):
403403
key = instant
404404

405-
elif isinstance(instant, Period):
405+
elif isinstance(instant, types.Period):
406406
key = instant.start
407407

408408
elif isinstance(instant, (str, int)):

package-lock.json

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)