I have some class
class A(object):
def __init__(self, data):
self._data = data
def _equals(self, other):
return self._data == other._data
Pycharm doesn't like that I access other._data
because it is private.
"Access to protected member"
This doesn't make sense to me, because the access is made from within the class.
How do I either suppress this warning, or write correct code?
If you really need it, like namedlist's ._asdict()
, the answer is Can I get PyCharm to suppress a particular warning on a single line?:
class A(object):
def __init__(self, data):
self._data = data
def _equals(self, other):
# noinspection PyProtectedMember
return self._data == other._data
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