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.
评论列表
文章目录