News for hackers. Stuff that matters.
Re:Ruff v0.16.0 – Significant new updates – 413 default rule... by wodenokoto on Sunday July 26, 2026 @07:17AM (#49056927)
It’s because you forgot a comma after the last item. If you had kept that the items wouldn’t have been compacted (at least in black, I’ve stopped linking my code because it breaks intends of formatting more often than it helps)
Re:Ruff v0.16.0 – Significant new updates – 413 default rule... by maratc on Sunday July 26, 2026 @08:23AM (#49057414)
Sorry, but I did not "forg[e]t a comma after the last item". I intentionally did not put a comma there. The list of the "important numbers" in my example is already complete and perfect, and is not supposed to ever change. I wanted to emphasise this fact by specifically omitting the comma there, in the hope that intelligent people in the future would get this message exactly as I intended for it to be.
[dead]
Re:Ruff v0.16.0 – Significant new updates – 413 default rule... by tclancy on Sunday July 26, 2026 @02:48PM (#49061106)
Yeah, but artfully dropped.
Re:Ruff v0.16.0 – Significant new updates – 413 default rule... by cyberrock on Sunday July 26, 2026 @08:57AM (#49057726)
I think all of us have worked on code that other people thought was perfect or will never change. Personally I love this rule because it saves me from looking at one extra commit (adding the comma when the next value gets added) when I'm trying dig through line history.
Re:Ruff v0.16.0 – Significant new updates – 413 default rule... by CuriouslyC on Sunday July 26, 2026 @08:42AM (#49057568)
The trailing comma rule is to avoid errors when devs copy/paste a line or dump a new line at the end. This matters particularly for arrays in languages with implicit string concatenation, where the missing comma won't trigger a compile error.
Re:Ruff v0.16.0 – Significant new updates – 413 default rule... by mylifeandtimes on Sunday July 26, 2026 @01:02PM (#49060056)
yes, and isn't it funny that

foo=[baz, bar,]

returns a nice list of two items, but if you edit this down and miss the comma,

foo=bar,

is not a scalar.

returning a tuple.

So the trailing comma thing is a thing.

Re:Ruff v0.16.0 – Significant new updates – 413 default rule... by 9dev on Sunday July 26, 2026 @08:49AM (#49057639)
You will find that pretty much every rule we have in any possible context will have some exceptions that are justified under some conditions.

Taking that as a reason to not have those rules in the first place seems like a logical fallacy that intelligent people should not make.

Re:Ruff v0.16.0 – Significant new updates – 413 default rule... by slig on Sunday July 26, 2026 @08:36AM (#49057521)
Must be nice to write code with the hopes that only intelligent people will read it.