def type_to_string(subtype):
    """
    convert a subtype (aka, ``types.*`` to a string)

        >>> type_to_string(type(10))
        'int'
        >>> type_to_string(package.module.SomeObject())
        'package.module.SomeObject'

    """
    subtype = str(subtype).replace("<type '", "").replace("'>", "")
    subtype = subtype.replace("<class '", "").replace("'>", "")
    return subtype