Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't use parent's public method with protected method in it. #164

Open
mostepunk opened this issue Oct 3, 2022 · 1 comment
Open

Can't use parent's public method with protected method in it. #164

mostepunk opened this issue Oct 3, 2022 · 1 comment

Comments

@mostepunk
Copy link

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.

@stepan-dolgorukov
Copy link

Today I faced the same problem. On the 31st of July, 2023 it's not fixed yet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants