I'm programming in pyCharm making a wxPython project (Mostly generated from wxGlade). If I have some code which specifies a string e.g.:
value_label = wx.StaticText(self, wx.ID_ANY, _("Value"))
It then complains about Unresolved reference '_'
. Is there any way to ignore only this unresolved reference?
You can change the settings of the Unresolved reference inspection:
_
to the list.Warning: this will ignore the unresolved reference _
in all source files of the project. This isn't usually a problem because it's highly unlikely that you'd use that kind of name for your functions. If you ever get a NameError
about _
then you already know that you forgot to call gettext.install
.
Alternatively:
_
.module_name._
I just checked and it's possible to limit this to only a module. If you are using _
inside module a
then add a._
to the list Ignore references and all usages of _
inside the a.py
module will be ignored, while the warnings will be shown for misuses of _
in other modules.
Another option is to include this above the class/method/function you are writing:
# noinspection PyUnresolvedReferences
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With