3 ms·
from typing import ( overload, List, etc..., ) would seem more sensible to me. I know you can make isort do that, I guess maybe not
by Joeboy 5y ago
from typing import (
overload,
List,
etc...,
)
would seem more sensible to me. I know you can make isort do that, I guess maybe not black.
- mrtranscendence 5y agoSorry, that's python-reorder-imports doing the reordering, not black. I just thought it was a related (but separate) project.
- OJFord 5y agoMy preference is actually for what GP doesn't like; the reason I don't like your suggestion is that: from typing import ( overload, ) is silly, but I don't want: -from typing import overload +from typing import ( + overload, + List, +) when all I actually did (semantically) was: + List,
- mrtranscendence 5y agoIt feels to me like importing names from a module gets you a set of names from that module, so I'm already thinking about it as a collection. It doesn't bother me at all that it's turned into a tuple and spread over multiple lines.
- OJFord 5y agoI think I prefer it (first example) to the diff (second), it's just that a singular thing imported is such a common case that three lines for it where it so easily fits on one does seem a bit silly. Maybe if I were allowed new syntax: from typing: import overload import List