def __new__(cls, tuple_):
<EOL>assert <NUM_LIT:3> <= len(tuple_) <= <NUM_LIT:4>, '<STR_LIT>' % (tuple_,)<EOL>attributes = None<EOL>if len(tuple_) == <NUM_LIT:4>:<EOL><INDENT>attributes = tuple_[<NUM_LIT:3>]<EOL>assert attributes is None or isinstance(attributes, Mapping), '<STR_LIT>' % (tuple_,)<EOL>if attributes:<EOL><INDENT>for invalid_key in {'<STR_LIT>', '<STR_LIT:value>', '<STR_LIT>'}:<EOL><INDENT>assert invalid_key not in attributes, '<STR_LIT>' % (invalid_key, tuple_,)<EOL><DEDENT><DEDENT><DEDENT>obj = super(ChoiceEntry, cls).__new__(cls, tuple_[:<NUM_LIT:3>])<EOL>obj.attributes = attributes<EOL>obj.constant = obj._get_choice_attribute(tuple_[<NUM_LIT:0>])<EOL>obj.value = obj._get_choice_attribute(tuple_[<NUM_LIT:1>])<EOL>obj.display = obj._get_choice_attribute(tuple_[<NUM_LIT:2>])<EOL>obj.choice = (obj.value, obj.display)<EOL>if attributes:<EOL><INDENT>for key, value in attributes.items():<EOL><INDENT>setattr(obj, key, value)<EOL><DEDENT><DEDENT>return obj<EOL>
Construct the tuple with 3 entries, and save optional attributes from the 4th one.