Pablo Galindo Salgado <pablog...@gmail.com> added the comment:
After PR17302 is merged we need to fix the following cosmetic issues indicated by Victor: (*) unparse adds many useless parentheses. The algorithm seems naive. For example, it adds "()" to "class _AddedDllDirectory():". It also adds parenthesis around yield, like "(yield (top, dirs, nondirs))", whereas the AST node was at "top level": it isn't a sub-expression. Maybe this algortihm should be made smarter. (*) newlines in docstring are rendered as two characters: "\" + "n" (escaped newline: \n), rather than a newline character. I would expect a newline, it's more common that \n... But it may "break" inline doctests rendering... Maybe it should be an option (render newlines as newline character or escape them?), or maybe even let the user choose how to render them using a callback (that's related to the "pluggable formatter" question). (*) Indentation is hardcoded to 4 spaces. What if I want 2 spaces or something different? Should it become an option? (*) Float infinity is replaces with 1e309. Again, maybe someone wants to render this differently? It sounds like an arbitrary choice (which "works" as expected). ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue38870> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com