Sebastian Kreft

Results 105 comments of Sebastian Kreft

Fixed the PR. In order to make it work I had to change one of the existing regexes, but the change should be safe. I also had to add a...

@jimmylai I'm not sure `_visit_and_replace_children` is the right place to add this logic, as one could programmatically create a `Module` without using the visitors and then calling `module.code`, which won't...

Hi @jimmylai, I still think that `_visit_and_replace_children` won't work, as one can generate an AST without using the visitor pattern. For example, the code below also triggers the bug: ```py...

I'm not suggesting to use the metadata in codegen, just to change `_codegen_impl` and `_parenthesize` to receive the parent, which is already available as the traversal is top to bottom....

@jimmylai Any chance to revisit this? It'd be great if we could discuss and agree on a proposal to fix this. After looking deeper into how other syntactic elements are...

That solution would make it impracticable to use in a code refactoring tool, as lots of unneeded parentheses would be added and unfortunately code formatters do not remove extra parens....

The problem seem to be in `self.get_metadata(QualifiedNameProvider, right_comp, set())`, as it returns ``` {QualifiedName(name='builtins.None', source=)} ``` Note that `format` is not the problem and the same error occurs when doing...

This bug is still happening with the latest version 0.1.4.

That's s really great. As an extra data point, this is the feature request I reported with the mypy team https://github.com/python/mypy/issues/4868. They are even considering on having a similar API.