Regarding these two options:
try:
userid = get_userid()
except:
userid = ""
vs.
userid = ""
try:
userid = get_userid()
except:
pass
Is there any difference, specifically wondering how the namespace would work out if userid
is only set within the try
block? Do they both have the same namespace scope?
Is one preferred over the other?