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

Overring __getattr__() seems not be the best idea to control access to attributes #29

Open
pboettch opened this issue Mar 24, 2022 · 0 comments

Comments

@pboettch
Copy link
Collaborator

We use getattr() to check whether the object (Catalogue or Event) is still viable. Otherwise we raise when accessing an attribute.

If the access is OK the base-class's getattr() is called. Except that the default base class might not have a getattr()-method.

According to pythons docs, it is better to use __getattribute__() method for a better access control: https://docs.python.org/3/reference/datamodel.html#object.__getattribute__

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

1 participant