Skip to content

PEP 767: Address feedback & open issues#4559

Merged
JelleZijlstra merged 11 commits intopython:mainfrom
Enegg:pep-767
Mar 11, 2026
Merged

PEP 767: Address feedback & open issues#4559
JelleZijlstra merged 11 commits intopython:mainfrom
Enegg:pep-767

Conversation

@Enegg
Copy link
Contributor

@Enegg Enegg commented Aug 25, 2025

  • Added my real name 🫠
  • Updated Post-History
  • Bikeshedded on some of the wording in this PEP
  • Clarified that use of bare ReadOnly is not allowed, and added that to rejected ideas
  • Specified that a protocol's read-only attributes are not accessible from its type (type[Protocol])
  • Closed open issue: "Extending Initialization"

📚 Documentation preview 📚: https://pep-previews--4559.org.readthedocs.build/

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
@Enegg Enegg requested a review from carljm as a code owner August 25, 2025 15:31
Copy link
Member

@hugovk hugovk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where are we up to with this PR? Can we merge it? Let's do so if there's no further feedback in ~a week.

Enegg and others added 4 commits February 26, 2026 20:40
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
"Terminology" section
allow initializing read-only attributes by subclass
allow `@classmethod` to initialize instance attributes
allow `ReadOnly` + `Final`, though redundant
Enegg added 2 commits March 9, 2026 23:27
Improve init rules regarding `__new__` and classmethods
Address Carl's comments
Copy link
Member

@carljm carljm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is looking pretty good to me! A few thoughts after another read-through.

Clarify that inheriting from a protocol makes it behave like a nominal class (wrt ReadOnly)
@carljm carljm requested a review from hugovk March 11, 2026 05:11
@carljm
Copy link
Member

carljm commented Mar 11, 2026

@hugovk not sure if the protocol here is for me as sponsor to just merge, or to get another once-over from a PEP editor? I'm happy for this to go in.

@JelleZijlstra
Copy link
Member

It's fine to just merge it! If you don't mind I'll read through it too though.

@JelleZijlstra JelleZijlstra merged commit 6f2e691 into python:main Mar 11, 2026
5 checks passed
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

Successfully merging this pull request may close these issues.

5 participants