You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Landscape.io reports accesses to protected members, but these members are visible in the class, because the passed method parameter is an instance of the class itself, and thus all protected members are visible.
The reported message is:
pylint: protected-access (W0212)
ToolMixIn.init(self, toolchain._platform, toolchain._dryrun, toolchain._binaryDirectoryPath, toolchain._version, toolchain._logger)
Access to a protected member _logger of a client class
Access to a protected member _version of a client class
Access to a protected member _binaryDirectoryPath of a client class
Access to a protected member _dryrun of a client class
Access to a protected member _platform of a client class
classExecutable:
passclassToolMixIn:
def__init__(self, platform, dryrun, binaryDirectoryPath, version, logger=None):
self._platform=platformself._dryrun=dryrunself._binaryDirectoryPath=binaryDirectoryPathself._version=versionself._logger=loggerclassActiveHDL(ToolMixIn):
"""Factory for executable abstractions in Active-HDL."""defGetVHDLCompiler(self):
"""Return an instance of Active-HDL's VHDL compiler 'vcom'."""returnVHDLCompiler(self)
classVHDLCompiler(Executable, ToolMixIn):
"""Abstraction layer of Active-HDL's VHDL compiler 'vcom'."""def__init__(self, toolchain : ToolMixIn):
ToolMixIn.__init__(self, toolchain._platform, toolchain._dryrun, toolchain._binaryDirectoryPath, toolchain._version, toolchain._logger)
# ...
Please note, the factory ActiveHDL as well as the created object VHDLCompiler derive from ToolMixIn.
According to visibility rules of object oriented programming, this is valid code. The code checker in PyCharm doesn't complain about this code since I added a type hint: : ToolMixIn.
Landscape.io reports accesses to protected members, but these members are visible in the class, because the passed method parameter is an instance of the class itself, and thus all protected members are visible.
The reported message is:
Full Landscape.io report: .../Aldec/ActiveHDL.py#L227
I have this factory code:
Please note, the factory
ActiveHDL
as well as the created objectVHDLCompiler
derive fromToolMixIn
.According to visibility rules of object oriented programming, this is valid code. The code checker in PyCharm doesn't complain about this code since I added a type hint:
: ToolMixIn
.Related issues:
The text was updated successfully, but these errors were encountered: