Hacker News new | ask | show | jobs
by raverbashing 4857 days ago
The 1st example is better

(Yes, if len returns 0 it's evaluated as false, just tested this)

But for the 2nd I would prefer

if not len(request.pipeline):

1 comments

if len(request.pipeline):

you want to execute only if it has a length.

cool though, I am using pipelines for something at work and read this post and realized I was executing even if there was nothing to execute!

Oh, of course =)

I don't know why I put the 'not' there