Jelle Zijlstra

Results 643 comments of Jelle Zijlstra

Thanks, so I was indeed doing something silly :) May I suggest that Fixit should detect if the formatter empties the file and tells the user?

Well, at least it would have told me the issue was with the formatter and not with using relative paths or with the location of the config file or whatever...

Here are some thoughts: * mypy itself is actually also a good example of a fully typed Python codebase that's friendly to benchmarking. Comparing its performance with all types stripped...

> I'm unsure of how to get rid of the non-annotation stuff too (like cast, NewType, Protocol, etc.). I haven't tried this, but it may be feasible to do this...

I don't remember this bug every being reported to Black, for what it's worth. If you can reproduce it with just Black, please open an issue against Black.

> I assume it would not happen to a string in real code. That's correct, we only normalize whitespace in docstrings, not other strings.

I can't reproduce this crash on current main. Which is weird, because I don't think we fixed this since the last release.

It's fine to do for string literals. The compiler does this already anyway. ``` In [196]: dis.dis('"a" + "b"') 1 0 LOAD_CONST 2 ('ab') 2 RETURN_VALUE ```

This has a bunch of merge conflicts now, and there's still no consensus yet on whether we should even do this (but that should be discussed on the issue). Are...

There is a cache. If the file hasn't changed since the last time we ran Black, we don't do any processing.