climax.py 文件源码

python
阅读 35 收藏 0 点赞 0 评论 0

项目:climax 作者: miguelgrinberg 项目源码 文件源码
def argument(*args, **kwargs):
    """Decorator to define an argparse option or argument.

    The arguments to this decorator are the same as the
    `ArgumentParser.add_argument <https://docs.python.org/3/library/\
argparse.html#the-add-argument-method>`_
    method.
    """
    def decorator(f):
        if not hasattr(f, '_arguments'):
            f._arguments = []
        if not hasattr(f, '_argnames'):
            f._argnames = []
        f._arguments.append((args, kwargs))
        f._argnames.append(_get_dest(*args, **kwargs))
        return f
    return decorator
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号