def set_attributes(self, doc, fields, parent_type=None):
if parent_type:<EOL><INDENT>assert isinstance(parent_type, Struct)<EOL><DEDENT>self.subtypes = []<EOL>self._enumerated_subtypes = None  <EOL>self._is_catch_all = None  <EOL>super(Struct, self).set_attributes(doc, fields, parent_type)<EOL>if self.parent_type:<EOL><INDENT>self.parent_type.subtypes.append(self)<EOL><DEDENT>
See :meth:`Composite.set_attributes` for parameter definitions.