Craig Maloney ☕
Follow

I love Python to pieces...

... but ...

I desperately hate when a string gets interpreted as a list and suddenly I'm tracing down a bunch of single-character nonsense.

['f', 'u', 'c', 'k', ' ', 't', 'h', 'a', 't', ' ', 's', 'h', 'i', 't']

· tootstream · 0 · 0 · 8

@cwebber @craigmaloney ['I', ' ', 't', 'h', 'o', 'u', 'g', 'h', 't', ' ', 'i', 't', ' ', 'w', 'a', 's', ' ', 'j', 'u', 's', 't', ' ', 'm', 'e', '!']

(I ended up writing a one liner for a joke...).

@craigmaloney I've never gotten why every modern language seems to do weird stuff with its variable types. (Speaking as someone who has first and second years CS all in C and C++, plus BASIC in high school)

@craigmaloney We've got to go deeper

[['f'], ['u'], ['c'], ['k'], [' '], ['t'], ['h'], ['a'], ['t'], [' '], ['s'], ['h'], ['i'], ['t']]

@balrogboogie @craigmaloney There's also the JSON API version

{"string": [{"character": "f"}, {"character": "u"}, {"character": "c"}, {"character": "k"}, {"character": " "}, {"character": "t"}, {"character": "h"}, {"character": "a"}, {"character": "t"}, {"character": " "}, {"character": "s"}, {"character": "h"}, {"character": "i"}, {"character": "t"}]}

@balrogboogie @craigmaloney The effort-to-funny ratio for XML is too high 😄

@balrogboogie @zigg @craigmaloney nah, I mean EDI. It's an older standard for document exchange, and is generally a pain to work with.

@craigmaloney i may have code like assert not isinstantce(v, str) in some of my code.

Today I feel accomplished that more than a handful of people sent me code saying "fuck that shit" split into individual characters.

Truly we live in amazing times.

Sign in to participate in the conversation
Octodon

Octodon is a nice general purpose instance. more