Good question. Depends. :)  That one can go either way, depending on what 'port' actually is and who's reviewing. :) In this case I assume it's a dict. 'if port' would be desired if you want to make sure the dict also has info in it...  otherwise I tend to like the explicit None check as you have it. But I don't think we're real consistent on that.

We definitely use 'if foo' if we want something like "if foo is not None and foo != '' (or [] or {}) because it's much shorter and means the same thing.