accessify
accessify copied to clipboard
Can't use parent's public method with protected method in it.
Hello! Here my code that raises some errors that I can't understand.
class Car:
@protected
def start_engine(self):
return "Engine's sound."
def run(self):
return self.start_engine()
class Tesla(Car):
pass
if __name__ == "__main__":
t = Tesla()
t.run()
This code raises error
Traceback (most recent call last):
File "/home/mostepan/dev/food/plgr.py", line 98, in <module>
t.run()
File "/home/mostepan/dev/food/plgr.py", line 89, in run
return self.start_engine()
File "/home/mostepan/dev/food/venv/lib/python3.10/site-packages/accessify/access.py", line 112, in protected_wrapper
raise InaccessibleDueToItsProtectionLevelException(
accessify.errors.InaccessibleDueToItsProtectionLevelException: Tesla.start_engine() is inaccessible due to its protection level
I think there is an error somewhere.
Today I faced the same problem. On the 31st of July, 2023 it's not fixed yet.