-
-
Notifications
You must be signed in to change notification settings - Fork 30.9k
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
gh-106016: Support customizing of module attributes access with __setattr__/__delattr__ (PEP 726) #108261
Conversation
Misc/NEWS.d/next/Core and Builtins/2023-08-22-09-57-59.gh-issue-106016.lpbUq8.rst
Show resolved
Hide resolved
A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated. Once you have made the requested changes, please leave a comment on this pull request containing the phrase |
@vstinner, I have made the requested changes; please review again. But please see remarks about PyDict_GetItemRef() & PEP 562 test layout above. |
Thanks for making the requested changes! @vstinner: please review the changes made to this pull request. |
I created PR #108293 to add Lib/test/test_module/ directory. Once it will be merged, you can rebased your PR on top of it. |
Can you please rebase your PR on the main branch to get my #108293 change? (New Lib/test/test_module/ directory.) |
… __setattr__/__delattr__
Co-authored-by: Victor Stinner <[email protected]>
Co-authored-by: Victor Stinner <[email protected]>
Co-authored-by: Victor Stinner <[email protected]>
7e72a68
to
47d93ce
Compare
With proposed fixed, |
Co-authored-by: Victor Stinner <[email protected]>
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.
LGTM!
@vstinner, wait! Are you sure this pr doesn't require a PEP? |
We have a PEP for adding only one attribute ( A |
This seems to be broken on the main branch as well.
And PEP 562 (two attributes). Fair enough.
I've a draft PEP: https://raw.githubusercontent.com/skirpichev/peps/7cc52e7/pep-9999.rst |
I'm happy to sponsor if you'd like? A |
On Wed, Aug 23, 2023 at 06:21:16PM -0700, Adam Turner wrote:
I'm happy to sponsor
Ok. I'll prepare a PR today.
UPD: python/peps#3301
|
Update: PEP 726 – Module |
Even though Victor closed #106016, I think that this can remain open until the SC decides on the PEP. If it says no, close this. If yes, open a new issue and retarget this by editing the title with the new number. And edit further if required. |
Not sure I got idea of this bureaucracy:) If it's required to have an issue for a pr (as it seems) - we already have an associated issue, #106016. |
Merge conflict was fixed & added the reference to pep in docs. |
Thanks for review and sponsoring the pep. |
I'm not sure if this does require a PEP (e.g. Brett Cannon on d.p.o discussion thread told me that it "not necessarily"). If so, I've a draft PEP here: https://github.com/skirpichev/peps/tree/setdelattr (And I'm looking for feedback and a sponsor.)
@vstinner
References
__delattr__
method.)📚 Documentation preview 📚: https://cpython-previews--108261.org.readthedocs.build/