def badtype_error(attribute, allowedtypes):
    """ Wrong type of argument passed. Provide attribute and allowed types"""
    return TypeError(
        'Received attribute "%s" of type %s; however, allowed types are %s' %
        (attribute, type(attribute), allowedtypes))
