How to guard against nulls in python -
in python, how check if string either null or empty?
in c# have string.isnullorempty(some_string)
also, i'm doing regex like:
p = re.compile(...) = p.search(..).group(1) this break if group doesn't have @ index 1, how guard against ? i.e. how re-write 2 lines safely?
just check it. explicit better implicit, , 1 more line won't kill you.
a = p.search(...) if not none: # ...
Comments
Post a Comment