On 3/9/23 16:37, Cameron Simpson wrote:
On 09Mar2023 09:06, Alan Gauld <learn2prog...@gmail.com> wrote:

Just a note that some code formatters use a trailing comma on the last element to make the commas fold points. Both yapf (my preference) and black let you write a line like (and, indeed, flatten if short enough):

     ( a, b, c )

but if you write:

     ( a, b, c, )

they'll fold the lines like:

     ( a,
       b,
       c,
     )
Cameron Simpson <c...@cskk.id.au>


Thanks for the info, good to know, I actually do like the idea of trailing commas for tuples (helps prevent things like the difference between ("abc") and ("abc",) and makes swapping things around nicer.

I've just been using a lot of json lately and it has been subconsciously training me different, lol.
--
https://mail.python.org/mailman/listinfo/python-list

Reply via email to