Shantanu

Results 383 comments of Shantanu

This is a pretty common ask, e.g. see https://github.com/psf/black/issues/1281 Your best workaround right now is `# fmt: off/on` (fwiw this kind of thing is by far the most common reason...

Black doesn't promise to format all equivalent code the exact same way. Black's behaviour does depend on the previous formatting (although Black tries to avoid doing so). Magic trailing comma...

I ran into this as well. Would a PR adding an environment variable to disable auto-update be welcome? I'd also be happy to add a Github Actions workflow or something...

In terms of a reproducible benchmark, maybe: ``` ~/dev λ git clone --depth 100 https://github.com/torvalds/linux.git ~/dev λ cd linux ~/dev/linux master λ mv virt virt_fdfd ~/dev/linux master λ hyperfine -w...

Thanks for investigating / implementing! Looks like the maximum depth for the Linux source is 9, which is unlucky in that it's just past another deepening threshold. But if we...

Compare to the version in Python 3.6's `Tools/parser/unparse.py`: ``` if ((isinstance(t.value, ast.Num) and isinstance(t.value.n, int)) or (isinstance(t.value, ast.Constant) and isinstance(t.value.value, int))): ```

But 3.8's `Lib/test/test_tools/test_unparse.py` doesn't seem to contain tests for those either. I did find one or two random tests `common.py` doesn't have, which I've opened a PR for at #51

I've opened a PR with tests for 3.8 features at #52. Hope that's okay! There seems to be precedent with async constructs.

Yeah, looks like there's some controversy surrounding flake8 and importlib-metadata, e.g. https://github.com/python/importlib_metadata/pull/319 https://github.com/PyCQA/flake8/pull/1438 I'll see if I can get CI green, if not I'll abandon this :-)

Adding a pin in requirements-dev.txt to keep flake8 happy seems to have worked!