JPDev@programming.dev to Programmer Humor@programming.dev · 1 year agoThe Perfect Solutionprogramming.devimagemessage-square67linkfedilinkarrow-up1672
arrow-up1672imageThe Perfect Solutionprogramming.devJPDev@programming.dev to Programmer Humor@programming.dev · 1 year agomessage-square67linkfedilink
minus-squareMastershelf@lemmy.onelinkfedilinkarrow-up12·1 year agoTIL Python dictionaries allow trailing commas.
minus-squareEphera@lemmy.mllinkfedilinkarrow-up3·1 year agoYeah, I think, that’s only really JSON which is so pedantic about it…
minus-squareowenfromcanada@lemmy.worldlinkfedilinkEnglisharrow-up3·1 year agoYeah… sweats nervously in C
minus-squarerenzev@lemmy.worldlinkfedilinkarrow-up1·1 year agoPython 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
TIL Python dictionaries allow trailing commas.
Yeah, I think, that’s only really JSON which is so pedantic about it…
Yeah…
sweats nervously in C
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