this post was submitted on 17 Jan 2024
655 points (98.8% liked)

Programmer Humor

19207 readers
1306 users here now

Welcome to Programmer Humor!

This is a place where you can post jokes, memes, humor, etc. related to programming!

For sharing awful code theres also Programming Horror.

Rules

founded 1 year ago
MODERATORS
 
you are viewing a single comment's thread
view the rest of the comments
[–] Mastershelf@lemmy.one 10 points 8 months ago (2 children)

TIL Python dictionaries allow trailing commas.

[–] Ephera@lemmy.ml 3 points 8 months ago (1 children)

Yeah, I think, that's only really JSON which is so pedantic about it...

[–] owenfromcanada@lemmy.world 3 points 8 months ago

Yeah...

sweats nervously in C

[–] renzev@lemmy.world 1 points 7 months ago

Python is so great (half-sarcasm) that a trailing comma on its own constitutes a tuple (immutable list):

mytuple = 4,
assert len(mytuple) == 1
assert mytuple[0] == 4