New submission from Brian Carlson :
Test file linked. When unparsing the output from ast.parse on a simple class,
unparse throws an error: 'FunctionDef' object has no attribute 'lineno' for a
valid class and valid AST. It fails when programmatically building the module
AS
Brian Carlson added the comment:
The second solution seems more optimal, in my opinion. I monkey patched the
function like this in my own code:
```
def get_type_comment(self, node):
comment = self._type_ignores.get(node.lineno) if hasattr(node, "lineno")
else node.type_comm
Brian Carlson added the comment:
I don't think passing `lineno` and `column` is preferred. It makes code
generation harder because `lineno` and `column` are hard to know ahead of when
code is being unparsed.
--
___
Python tracker
&