Brian Carlson <briancarlson6...@gmail.com> 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_comment if comment is not None: return f" # type: {comment}" ``` Thanks! ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue46073> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com