missing python features: a safe .get() method for lists (like there is for dictionaries)

I get that there are a gazillion ways to implement this, even in an expression, but it's really inconvenient to write most of those when you're starting with an expression like data['thing'][0]['other thing'][4]

anyway I toot a lot about being mildly annoyed with python

(also please don't reply to this with Programming Help or things you found when you did a web search, thanks)

@aparrish All I can say is that I agree! There should be a defaultlist implementation, too.

@aparrish Python really has a lot of small annoyances. Not enough to say “fuck it” and find another language, but enough to wonder how and why things are the way they are.

@Ricardus "yeah, you're right!" or "I hear you" or "that's frustrating for me too" or no reply at all

@aparrish I love your new bio. ("I toot a lot about being mildly annoyed with python")

Sign in to participate in the conversation

Follow friends and discover new ones. Publish anything you want: links, pictures, text, video. This server is run by the main developers of the Mastodon project. Everyone is welcome as long as you follow our code of conduct!