Yes
Yes , it is safe, in the sense that the worst that can happen when an uninitialized locale is referenced is that a NameError exception will be thrown .
You actually have a slightly special case. Since the parser will see barbefore its reference, then the method will not raise NameError, even if it foois false, but the value barwill be nil.
source
share