diff --git a/src/ixbrlparse/components/_base.py b/src/ixbrlparse/components/_base.py index 05fa690..da5aff4 100644 --- a/src/ixbrlparse/components/_base.py +++ b/src/ixbrlparse/components/_base.py @@ -1,6 +1,6 @@ from copy import deepcopy from datetime import date -from typing import List, Optional, Union +from typing import List, Optional, Tuple, Union class ixbrlFormat: # noqa: N801 @@ -11,7 +11,7 @@ class ixbrlFormat: # noqa: N801 Attributes: format_names: A tuple of format names that this class should be used for.""" - format_names: tuple[str, ...] = () + format_names: Tuple[str, ...] = () def __init__( self, diff --git a/src/ixbrlparse/components/formats.py b/src/ixbrlparse/components/formats.py index 83249ea..bd7dd05 100644 --- a/src/ixbrlparse/components/formats.py +++ b/src/ixbrlparse/components/formats.py @@ -1,7 +1,7 @@ import datetime import re import warnings -from typing import Optional, Type, Union +from typing import Optional, Tuple, Type, Union from ixbrlparse.components._base import ixbrlFormat from ixbrlparse.hookspecs import hookimpl @@ -118,7 +118,7 @@ class ixtNumDotDecimal(ixbrlFormat): # noqa: N801 class ixtDateFormat(ixbrlFormat): # noqa: N801 - format_names = () + format_names: Tuple[str, ...] = () date_format = "%Y-%m-%d" def parse_value(self, value: Union[str, int, float]) -> Optional[datetime.date]: diff --git a/src/ixbrlparse/components/nonnumeric.py b/src/ixbrlparse/components/nonnumeric.py index d4c0fa2..75b54c8 100644 --- a/src/ixbrlparse/components/nonnumeric.py +++ b/src/ixbrlparse/components/nonnumeric.py @@ -31,7 +31,7 @@ def __init__( self.context = context self.format: Optional[ixbrlFormat] = None self.text: Optional[str] = value - self.value = value + self.value: Optional[int | float | date | None | str] = value if isinstance(format_, str) and format_ != "" and self.text is not None: try: self.format = get_format(format_)(format_=format_)