spent an hour writing a small #python script, most of that time was trying to find a way to avoid an if statement I was convinced was totally unnecessary. I couldn't and although the script works perfectly I feel it's a bit of a failure.
@xvilo Sure, it's just a bit of disposable code to generate some firewall config from a csv. My issue is line 9, I was appending to a dict value but the first time the value returns None so I ended up testing for that, it just seems messy to me. https://gist.github.com/dnel/583bb49ccd75023c2acd10c29a2e1ace
@xvilo I can get a little obcessed with optimisation, it would save nanoseconds but reducing my code by 3 lines, totally worth it 😄
General purpose mastodon instance