# Path: typepy/_typecode.py
# class Typecode(enum.Enum):
#     NONE = 0
#     INTEGER = 1 << 0
#     REAL_NUMBER = 1 << 1
#     STRING = 1 << 2
#     NULL_STRING = 1 << 3
#     DATETIME = 1 << 4
#     INFINITY = 1 << 5
#     NAN = 1 << 6
#     BOOL = 1 << 7
#     DICTIONARY = 1 << 8
#     LIST = 1 << 9
#     IP_ADDRESS = 1 << 10
#     BYTES = 1 << 11
# 
# Path: typepy/checker/_interface.py
# class TypeCheckerInterface(metaclass=abc.ABCMeta):
#     @abc.abstractmethod
#     def is_type(self) -> bool:  # pragma: no cover
#         pass
# 
#     @abc.abstractmethod
#     def validate(self) -> None:  # pragma: no cover
#         pass
# 
# Path: typepy/converter/_interface.py
# class ValueConverterInterface(metaclass=abc.ABCMeta):
#     @abc.abstractmethod
#     def force_convert(self):  # pragma: no cover
#         pass
# 
# Path: typepy/error.py
# class TypeConversionError(TypeError):
#     """
#     Exception raised when failed to convert data.
#     """


import abc
from typing import Any, Optional
from .._typecode import Typecode
from ..checker._interface import TypeCheckerInterface
from ..converter import ValueConverterInterface
from ..error import TypeConversionError
                f"value={self._data}",
                f"typename={self.typename}",
                f"strict_level={self._strict_level}",
                f"is_type={self.is_type()}",
                f"try_convert={self.try_convert()}",
            ]
        )

    def is_type(self) -> bool:
        """
        :return:
        :rtype: bool
        """

        if self.__is_type_result is not None:
            return self.__is_type_result

        self.__is_type_result = self.__is_type()

        return self.__is_type_result

    def __is_type(self) -> bool:
        if self.__checker.is_type():
            return True

        if self.__checker.is_exclude_instance():
            return False

        try:
            self._converted_value = self.__converter.force_convert()

# Path: typepy/_typecode.py
# class Typecode(enum.Enum):
#     NONE = 0
#     INTEGER = 1 << 0
#     REAL_NUMBER = 1 << 1
#     STRING = 1 << 2
#     NULL_STRING = 1 << 3
#     DATETIME = 1 << 4
#     INFINITY = 1 << 5
#     NAN = 1 << 6
#     BOOL = 1 << 7
#     DICTIONARY = 1 << 8
#     LIST = 1 << 9
#     IP_ADDRESS = 1 << 10
#     BYTES = 1 << 11
# 
# Path: typepy/checker/_interface.py
# class TypeCheckerInterface(metaclass=abc.ABCMeta):
#     @abc.abstractmethod
#     def is_type(self) -> bool:  # pragma: no cover
#         pass
# 
#     @abc.abstractmethod
#     def validate(self) -> None:  # pragma: no cover
#         pass
# 
# Path: typepy/converter/_interface.py
# class ValueConverterInterface(metaclass=abc.ABCMeta):
#     @abc.abstractmethod
#     def force_convert(self):  # pragma: no cover
#         pass
# 
# Path: typepy/error.py
# class TypeConversionError(TypeError):
#     """
#     Exception raised when failed to convert data.
#     """


# Path: typepy/type/_base.py
import abc
from typing import Any, Optional
from .._typecode import Typecode
from ..checker._interface import TypeCheckerInterface
from ..converter import ValueConverterInterface
from ..error import TypeConversionError

                f"value={self._data}",
                f"typename={self.typename}",
                f"strict_level={self._strict_level}",
                f"is_type={self.is_type()}",
                f"try_convert={self.try_convert()}",
            ]
        )

    def is_type(self) -> bool:
        """
        :return:
        :rtype: bool
        """

        if self.__is_type_result is not None:
            return self.__is_type_result

        self.__is_type_result = self.__is_type()

        return self.__is_type_result

    def __is_type(self) -> bool:
        if self.__checker.is_type():
            return True

        if self.__checker.is_exclude_instance():
            return False

        try:
            self._converted_value = self.__converter.force_convert()

        except TypeConversionError: