gh-106016: Support customizing of module attributes access with __setattr__/__delattr__ (PEP 726) - #108261
gh-106016: Support customizing of module attributes access with __setattr__/__delattr__ (PEP 726)#108261skirpichev wants to merge 21 commits into
Conversation
|
@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 <vstinner@python.org>
Co-authored-by: Victor Stinner <vstinner@python.org>
Co-authored-by: Victor Stinner <vstinner@python.org>
7e72a68 to
47d93ce
Compare
|
With proposed fixed, |
Co-authored-by: Victor Stinner <vstinner@python.org>
|
@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. |

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/