import re


def extract_type(obj):
    """Get the name of a Python object, based on its type

    Args:
        obj (object): Python object
    Returns:
        str:
    """
    pattern = re.compile(r"^<class '(?P<obj_type>[.a-zA-Z/_]*)'>$")
    match = pattern.match(str(type(obj)))
    ans = match.group('obj_type') if match else str(type(obj))
    translator = dict(NoneType='None')
    ans = ans.split(".")[-1]
    return translator.get(ans, ans)