# AUTOGENERATED! DO NOT EDIT! File to edit: ../nbs/00_core.ipynb.

# %% auto 0
__all__ = ['iscls', 'isint', 'isstr', 'isset', 'isnum', 'isbool', 'iscall', 'isdict', 'islist', 'isiter', 'isnone', 'isany',
           'istuple']

# %% ../nbs/00_core.ipynb 4
import inspect
from numbers import Number
from typing import Any, Type, Callable, Iterable, TypeGuard

# %% ../nbs/00_core.ipynb 6
def iscls(x: Type) -> TypeGuard[Type]:
    '''Check if `x` is a `class`.'''
    return inspect.isclass(x)

def isint(x) -> TypeGuard[int]:
    '''Check if `x` is an `int`.'''
    return isinstance(x, int)

def isstr(x) -> TypeGuard[str]:
    '''Check if `x` is an `str`.'''
    return isinstance(x, str)

def isset(x) -> TypeGuard[set]:
    '''Check if `x` is a `set`.'''
    return isinstance(x, set)

def isnum(x) -> TypeGuard[Number]: 
    '''Check if `x` is a `Number`.'''
    return isinstance(x, Number)

# %% ../nbs/00_core.ipynb 7
def isbool(x) -> TypeGuard[bool]:
    '''Check if `x` is `bool`.'''
    return isinstance(x, bool)

def iscall(x) -> TypeGuard[Callable]:
    '''Check if `x` is `Callable`.'''
    return isinstance(x, Callable)

def isdict(x) -> TypeGuard[dict]:
    '''Check if `x` is a `dict`.'''
    return isinstance(x, dict)

def islist(x) -> TypeGuard[list]:
    '''Check if `x` is a `list`.'''
    return isinstance(x, list)

def isiter(x) -> TypeGuard[Iterable]:
    '''Check if `x` is an `Iterable`.'''
    return isinstance(x, Iterable)

def isnone(x) -> TypeGuard[None]:
    '''Check if `x` is `None`.'''
    return x is None

def isany(x) -> TypeGuard[Any]:
    '''Check if `x` is not `None`.'''
    return not isnone(x)

# %% ../nbs/00_core.ipynb 8
def istuple(x) -> TypeGuard[tuple]:
    '''Check if `x` is an `tuple`.'''
    return isinstance(x, tuple)
