When I import a function at the top of my file and later use it in a function, in which I reassign it later on, python complains about Unresolved reference '_'
, e.g.:
from django.utils.translation import ugettext_lazy as _
def test():
msg = _('Message') # <= Unresolved reference '_'
instance, _ = Something.objects.get_or_create(...)
what's happening here? Why python says Unresolved reference
when evaluating the function, when it is only reassigned later on the next line?