public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Simon Marchi <simark@simark.ca>
To: Tom Tromey <tom@tromey.com>, Simon Marchi <simon.marchi@efficios.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCH] gdb: add type annotations to ada-unicode.py
Date: Thu, 25 Apr 2024 14:37:41 -0400	[thread overview]
Message-ID: <90050caa-bfc2-40b6-aa63-5c79968f3c45@simark.ca> (raw)
In-Reply-To: <87bk5xgv08.fsf@tromey.com>

On 4/25/24 2:25 PM, Tom Tromey wrote:
>>>>>> "Simon" == Simon Marchi <simon.marchi@efficios.com> writes:
> 
> Simon> Add type annotations to ada-unicode.py, just enough to make pyright
> Simon> happy:
> 
> Ok.
> Approved-By: Tom Tromey <tom@tromey.com>

Thanks, will push.

> Simon> +        print(
> Simon> +            f"   {{{r.range_start}, {r.range_end}, {r.upper_delta}, {r.lower_delta}}},",
> Simon> +            file=f,
> Simon> +        )
> 
> This trailing comma seems weird.

When it decides to put the arguments one per like, black adds that
trailing comma.  I guess it avoids having a diff on this line should you
add another argument after that.

You can also add the trailing comma yourself to force black to put
things one per line:

foo = (1, 2, 3)
bar = (
    1,
    2,
    3,
)

print("foo")
print(
    "foo",
)

It sometimes makes things more readable (not in the dummy examples
above, but in real life code).

Simon

      reply	other threads:[~2024-04-25 18:37 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-25 17:26 Simon Marchi
2024-04-25 18:25 ` Tom Tromey
2024-04-25 18:37   ` Simon Marchi [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=90050caa-bfc2-40b6-aa63-5c79968f3c45@simark.ca \
    --to=simark@simark.ca \
    --cc=gdb-patches@sourceware.org \
    --cc=simon.marchi@efficios.com \
    --cc=tom@tromey.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).