Blackening redux (was: Re: Auto-formatting code with black - object now if you have a strong opinion)

Martin von Zweigbergk martinvonz at google.com
Wed May 8 23:02:54 EDT 2019


*From: *Matt Harbison <mharbison72 at gmail.com>
*Date: *Wed, May 8, 2019, 19:56
*To: *Augie Fackler, Martin von Zweigbergk
*Cc: *Mercurial-devel, Gregory Szorc

On Wed, 08 May 2019 17:13:30 -0400, Martin von Zweigbergk
> <martinvonz at google.com> wrote:
>
> > *From: *Augie Fackler <raf at durin42.com>
> > *Date: *Wed, May 8, 2019 at 2:05 PM
> > *To: *martinvonz
> > *Cc: *Matt Harbison, Mercurial-devel, Gregory Szorc
> >
> >
> >>
> >> > On May 8, 2019, at 16:53, martinvonz <martinvonz at google.com> wrote:
> >> >
> >> >>  * one-tuples will get forced down to a single line, even if they
> >> started on multiple lines
> >> >
> >> > I don't know what this means. One-tuples are very rare anyway, so it
> >> probably doesn't matter much.
> >>
> >> If you write this:
> >>
> >> FOO = (
> >>     'bar',
> >> )
> >>
> >> black will make it be
> >>
> >> FOO = ('bar',)
> >>
> >> even though there's a trailing comma, because it's the one place where a
> >> trailing comma is required in Python. Does that make sense?
> >>
> >
> > The example makes sense, but why would we want a one-tuple on multiple
> > lines?
>
> I think `directsymbols` in import-checker.py is an example that I noticed
> in D6342.  Maybe it can be turned into a list.
>

I had not seen that example, but that's the type of uses I had imagined.
And I had imagined that they could just use a list, as you said.

>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.mercurial-scm.org/pipermail/mercurial-devel/attachments/20190508/2da59cb3/attachment.html>


More information about the Mercurial-devel mailing list