Skip to content

PEP 842: Module Exports#5057

Open
ZeroIntensity wants to merge 8 commits into
python:mainfrom
ZeroIntensity:pep-842/initial-revision
Open

PEP 842: Module Exports#5057
ZeroIntensity wants to merge 8 commits into
python:mainfrom
ZeroIntensity:pep-842/initial-revision

Conversation

@ZeroIntensity

Copy link
Copy Markdown
Member

Basic requirements (all PEP Types)

  • Read and followed PEP 1 & PEP 12
  • File created from the latest PEP template
  • PEP has next available number, & set in filename (pep-NNNN.rst), PR title (PEP 123: <Title of PEP>) and PEP header
    • Tip: find the next available number with pepotron — run uvx pepotron next (or pipx install pepotron then pep next)
  • Title clearly, accurately and concisely describes the content in 79 characters or less
  • Core dev/PEP editor listed as Author or Sponsor, and formally confirmed their approval
  • Author, Status (Draft), Type and Created headers filled out correctly
  • PEP-Delegate, Topic, Requires and Replaces headers completed if appropriate
  • Required sections included
    • Abstract (first section)
    • Copyright (last section; exact wording from template required)
  • Code is well-formatted (PEP 7/PEP 8) and is in code blocks, with the right lexer names if non-Python
  • PEP builds with no warnings, pre-commit checks pass and content displays as intended in the rendered HTML
  • Authors/sponsor added to .github/CODEOWNERS for the PEP

Standards Track requirements

  • PEP topic discussed in a suitable venue with general agreement that a PEP is appropriate
  • Suggested sections included (unless not applicable)
    • Motivation
    • Specification
    • Rationale
    • Backwards Compatibility
    • Security Implications
    • How to Teach This
    • Reference Implementation
    • Rejected Ideas
    • Open Issues
    • Acknowledgements
    • Footnotes
    • Change History
  • Python-Version set to valid (pre-beta) future Python version, if relevant
  • Any project stated in the PEP as supporting/endorsing/benefiting from the PEP formally confirmed such
  • Right before or after initial merging, PEP discussion thread created and linked to in Discussions-To and Post-History

@ZeroIntensity ZeroIntensity added the new-pep A new draft PEP submitted for initial review label Jul 25, 2026
@ZeroIntensity
ZeroIntensity requested a review from a team as a code owner July 25, 2026 04:37
@read-the-docs-community

read-the-docs-community Bot commented Jul 25, 2026

Copy link
Copy Markdown

Documentation build overview

📚 pep-previews | 🛠️ Build #33757115 | 📁 Comparing c9a6a30 against latest (9bb3132)

  🔍 Preview build  

5 files changed · + 1 added · ± 4 modified

+ Added

± Modified

Comment thread peps/pep-0842.rst
Semantic implementation
-----------------------

For a module, defining ``__export__`` is roughly equivalent to adding the

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Is that equivalent? __getattr__ only gets called if the name is not found the normal way.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

It's not, but I wasn't sure how else to represent it. Any ideas?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I guess __getattribute__ is a closer analogue. But maybe just don't try to write equivalent code if there's such a major difference.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

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.

Comment thread peps/pep-0842.rst Outdated
Comment thread peps/pep-0842.rst Outdated
Comment thread peps/pep-0842.rst Outdated
Comment thread peps/pep-0842.rst Outdated
Comment thread peps/pep-0842.rst Outdated
ZeroIntensity and others added 3 commits July 25, 2026 10:19
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

new-pep A new draft PEP submitted for initial review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants