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

Reject assignments when __setattr__ has NoReturn return type #1052

Open
JukkaL opened this issue Dec 5, 2015 · 0 comments
Open

Reject assignments when __setattr__ has NoReturn return type #1052

JukkaL opened this issue Dec 5, 2015 · 0 comments

Comments

@JukkaL
Copy link
Collaborator

JukkaL commented Dec 5, 2015

Consider this class:

class A:
    def __setattr__(self, x, y):
        raise RuntimeError

The above implementation should be considered special and all attribute assignments via A, including via self should be rejected.

This is related to #521 (general __setattr__ support).

@JukkaL JukkaL added the feature label Dec 5, 2015
@hauntsaninja hauntsaninja changed the title __setattr__ method that just raises an exception Reject assignments when __setattr__ has NoReturn return type Aug 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant