def infer_typing_namedtuple_class(class_node, context=None):
<EOL>annassigns_fields = [<EOL>annassign.target.name<EOL>for annassign in class_node.body<EOL>if isinstance(annassign, nodes.AnnAssign)<EOL>]<EOL>code = dedent(<EOL>"""<STR_LIT>"""<EOL>).format(typename=class_node.name, fields="<STR_LIT:U+002C>".join(annassigns_fields))<EOL>node = extract_node(code)<EOL>generated_class_node = next(infer_named_tuple(node, context))<EOL>for method in class_node.mymethods():<EOL><INDENT>generated_class_node.locals[method.name] = [method]<EOL><DEDENT>return iter((generated_class_node,))<EOL>
Infer a subclass of typing.NamedTuple