-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
PEP 767: Address feedback & open issues #4559
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
Conversation
Clarify that bare `ReadOnly` is not allowed, and add that to rejected ideas Specify that `type[Protocol]` does not inherit the protocol's attributes Close issue: "Extending Initialization" Bikeshed on some wording Use my real name
peps/pep-0767.rst
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The meaning of "reassign" here is not clear. (What is an "assignment" and what is a "reassignment"?)
I think it's clarified below, but maybe we should reference that here.
peps/pep-0767.rst
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think @oscarbenjamin raised an interesting point in the Discourse thread about this. The effects of ReadOnly as described in this PEP (structural typing and variance of generics) only require for soundness that we disallow external mutation of the attribute. Disallowing internal mutation (within methods of the class) is not required for soundness, and is arguably veering too far into Final territory.
It would simplify this section (and type checker implementations) quite a lot if we just specified that ReadOnly describes the external interface of the attribute, and all internal reassignments of a ReadOnly attribute (within methods of the class) are permitted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Uh oh!
There was an error while loading. Please reload this page.
ReadOnlyis not allowed, and added that to rejected ideastype[Protocol])📚 Documentation preview 📚: https://pep-previews--4559.org.readthedocs.build/