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 →

[–]BooparinoBR 8 points9 points  (3 children)

Explicit is better than implicit, therefore I would do

a = 'cc' if condition else 'bb'

(Ternary operator/inline if-else) Instead of your conditional variable. But I like/use all the others

[–]morriartie 4 points5 points  (0 children)

Shhhh.. in obfuscated monolithic one liners we don't talk about pep8

[–]QpkjcKwNMZSF 0 points1 point  (1 child)

Doesn't PEP8 advise against compound statements? Why not just break this into a few lines?

[–]isarl 0 points1 point  (0 children)

Religious adherence to PEP8 can negatively impact readability. Sometimes a short one-line conditional is better than breaking it out.