Inspectopedia Help

Accessing a protected member of a class or a module

Reports cases when a protected member is accessed outside the class, a descendant of the class where it is defined, or a module.

Example:

class Foo: def _protected_method(self): pass class Bar(Foo): def public_method(self): self._protected_method() foo = Foo() foo._protected_method() # Access to a protected method

Inspection options

Option

Type

Default

Ignore test functions

Checkbox

true

Ignore annotations

Checkbox

false

Inspection Details

Available in:

DataSpell 2023.3, PyCharm 2023.3

Plugin:

Python Community Edition, 233.SNAPSHOT

Last modified: 13 July 2023