def _prepare_arg(arg):
    """Return a keyword arg spec (dict)"""
    _arg = {'name': arg.name}
    if arg.annotation != arg.empty:
        try:
            name = str(arg.annotation.__name__)
        except AttributeError:
            name = str(arg.annotation._name)
        _arg['type'] = name
        _arg['annotation'] = arg.annotation
    if arg.empty is not arg.default:
        _arg['default'] = arg.default
    return _arg
