namedlist.py 文件源码

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

项目:appcompatprocessor 作者: mbevilacqua 项目源码 文件源码
def _check_specific_to_fields(self, name):
        # these tests don't apply for the typename, just the fieldnames
        if name in self.seen_fields:
            raise ValueError('Encountered duplicate field name: '
                             '{0!r}'.format(name))

        if name.startswith('_'):
            raise ValueError('Field names cannot start with an underscore: '
                             '{0!r}'.format(name))


########################################################################
# Returns a function with name 'name', that calls another function 'chain_fn'
# This is used to create the __init__ function with the right argument names and defaults, that
#  calls into _init to do the real work.
# The new function takes args as arguments, with defaults as given.
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号