PEP 842: Module Exports#5057
Open
ZeroIntensity wants to merge 8 commits into
Open
Conversation
Documentation build overview
5 files changed ·
|
| Semantic implementation | ||
| ----------------------- | ||
|
|
||
| For a module, defining ``__export__`` is roughly equivalent to adding the |
Member
There was a problem hiding this comment.
Is that equivalent? __getattr__ only gets called if the name is not found the normal way.
Member
Author
There was a problem hiding this comment.
It's not, but I wasn't sure how else to represent it. Any ideas?
Member
There was a problem hiding this comment.
I guess __getattribute__ is a closer analogue. But maybe just don't try to write equivalent code if there's such a major difference.
Member
Author
There was a problem hiding this comment.
Let's try __getattribute__. I added a magic patching call to try to make it clearer that it's not an actual thing Python supports.
hugovk
reviewed
Jul 25, 2026
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Basic requirements (all PEP Types)
pep-NNNN.rst), PR title (PEP 123: <Title of PEP>) andPEPheaderuvx pepotron next(orpipx install pepotronthenpep next)AuthororSponsor, and formally confirmed their approvalAuthor,Status(Draft),TypeandCreatedheaders filled out correctlyPEP-Delegate,Topic,RequiresandReplacesheaders completed if appropriate.github/CODEOWNERSfor the PEPStandards Track requirements
Python-Versionset to valid (pre-beta) future Python version, if relevantDiscussions-ToandPost-History