jit.py 文件源码

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

项目:toasted-marshmallow 作者: lyft 项目源码 文件源码
def attr_str(attr_name):
    # type: (str) -> str
    """Gets the string to use when accessing an attribute on an object.

    Handles case where the attribute name collides with a keyword and would
    therefore be illegal to access with dot notation.
    """
    if keyword.iskeyword(attr_name):
        return 'getattr(obj, "{0}")'.format(attr_name)
    return 'obj.{0}'.format(attr_name)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号