does this code run rule

kingthrillgore@lemmy.ml to 196@lemmy.blahaj.zone – 293 points –
44

You are viewing a single comment

People used to argue that Python was incredibly readable. Then I started seeing shit like this.

I'd say this is pretty readable

It jams far too much on one line. Break it up. It's a mistake I see a lot on Python.

but if you do it as a for loop it would be slower

Unless you're looping over more than a million elements, that's a poor excuse.

I think that Python has a bit of a 'Microsoft Word' thing on the go. You know how your own docs are completely editable and print fine, but everyone else's are a complete fucking disaster and pressing a single key will screw up the formatting of the whole document? Your own Python code is full of sensible idioms and pragmatic naming conventions, but everyone else's was plainly written while on mushrooms.

I don't know python, but it's clear what that line does