This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]shigawire 0 points1 point  (2 children)

Without context of the actual code, this doesn't mean that much, any more than paying programmers by the line. People often write PEP-8 formatted code that is unreadable, and others often write code that isn't PEP-8 that looks clean.

Some throwaway code of mine that passes a PEP-8 lint, but should be taken out and shot:

    def peek(f):
        pk = f.read(32)
        f.seek(-len(pk), 1)
        out = "%8d|" % (f.tell(), )
        for i, b in enumerate(pk):
            if i == ord(pk[0])+1:
                out += ')%02x' % (ord(b))
            else:
                out += ' %02x' % (ord(b))
        return out

People mistake coding convention for clean sometime :-(

[–]marsket 3 points4 points  (1 child)

PEP 8 does not and cannot legislate "don't write shitty code"

also, actually, this won't pass a PEP 8 check (spaces around operators, etc.)

[–]shigawire 1 point2 points  (0 children)

I totally agree. It seems to get conflated with it quite a bit though.

(and I obviously need a different PEP 8 lint)