David ๐ŸŒ  is a user on mastodon.org.uk. You can follow them or interact with them if you have an account anywhere in the fediverse. If you don't, you can sign up here.
David ๐ŸŒ  @stardot

spent an hour writing a small 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.

ยท Web ยท 0 ยท 2

@stardot Why not share the script! Would be nice to take a look at it

@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. gist.github.com/dnel/583bb49cc

@xvilo I can get a little obcessed with optimisation, it would save nanoseconds but reducing my code by 3 lines, totally worth it ๐Ÿ˜„