>>1316676>what does that picture have to do with what you're saying?>>1316671>A lot of its syntax is overly concise, unintuitive, and overloadedfoo = 3
bar = 1
print (("foo","bar")[(foo<bar)])
What can we notice about this?
- it appears to be a ternary, but Python doesn't have ternaries
- it works by accident because of tuples and the intiness of truthy values: (foo<bar) is silently coerced from a conditional statement, into a boolean, then into an int
- the "parameters" are backwards compared to a C (and every other language) ternary, so if you're not paying attention your condition will be reversed
This is all kinda representative of what Python has become: it started off as a clean simple language more legible than bash but less verbose than c and java, but then feature after feature after feature was added to it, and now your average bit of "clever python" is a mess of brackets and colons and percents that all have special different meanings in this specific construct.