Hello everyone,
I noticed the --sort-reexports option in the 9.0.0b1 release and wanted to try it out (I hadn't noticed it before).
It works brilliantly, especially in the 9.0.0b1 pre-release, but I noticed that it does not retain trailing commas of an __all__ declaration, even with --profile black. I'm not sure if this is desired behaviour, especially when the __all__ length is too short to trigger black's chopping-down of the entries, but I wanted to at the very least highlight that this happens.
It's not a major problem, but it does clash a bit with the "one-per-line" style of __all__ declaration.
Reproduction:
my_package/__init__.py
from .first import FirstClass
from .second import SecondClass
- __all__ = (
- "FirstClass",
- "SecondClass",
- )
+ __all__ = ("FirstClass", "SecondClass")
The other files
my_package/first.py
my_package/second.py
Hello everyone,
I noticed the
--sort-reexportsoption in the 9.0.0b1 release and wanted to try it out (I hadn't noticed it before).It works brilliantly, especially in the 9.0.0b1 pre-release, but I noticed that it does not retain trailing commas of an
__all__declaration, even with--profile black. I'm not sure if this is desired behaviour, especially when the__all__length is too short to triggerblack's chopping-down of the entries, but I wanted to at the very least highlight that this happens.It's not a major problem, but it does clash a bit with the "one-per-line" style of
__all__declaration.Reproduction:
my_package/__init__.pyThe other files
my_package/first.pymy_package/second.py