def __instancecheck__(cls, obj):
    """
        Allows datatype to be used in isinstance() function.
        """
    if cls.pyex is not None:
        return isinstance(obj, cls.py) and not isinstance(obj, cls.pyex)
    else:
        return isinstance(obj, cls.py)
