Y
Hacker News
new
|
ask
|
show
|
jobs
by
jksmith
6132 days ago
Please, for the love of conciseness, never assign a boolean based on an if statement.
2 comments
dmoho
6132 days ago
What if the assignment to the boolean was only one of the things you wanted to execute based on the result of the if statement?
link
jksmith
6132 days ago
Even then, I'd rather see:
DEBUG = socket.gethostname() == 'developmentcomp'
if DEBUG then...
link
rbanffy
6132 days ago
It's not
link
aichcon
6132 days ago
How would you rewrite it?
link
jpeterson
6132 days ago
DEBUG = socket.gethostname() == 'developmentcomp'
link