Skip to content

PEP 726 -- Module __setattr__ and __delattr__ #216

Closed

Description

@skirpichev

Please consider PEP 726 -- Module __setattr__ and __delattr__
https://peps.python.org/pep-0726/

  • The PEP has been discussed in threads listed in its Post-History header
  • The PEP was announced on Discuss (link in Post-History)
  • The PEP includes all relevant Suggested Sections
  • The PEP includes endorsements from the projects/groups/people it helps
  • The PEP has a CODEOWNERS entry

Activity

  1. gpshead commented on Feb 28, 2024

    @gpshead
    Member

    Thanks for the PEP and apologies on our end for the review & response delay:

    The Python Steering Council has discussed PEP-726 – Module __setattr__ and __delattr__ and decided to Reject it.

    We did not see clear consensus in the community about use cases such as read-only module attributes, and we are concerned that going further down the route of modules behaving semi-class-like may lead to future performance optimization challenges and confusing semantics. We do not find there to be a strong need for having read-only module attributes, and even if there is one, this is not the ideal solution to that problem. Preventing one possible mis-use of modules did not seem compelling enough.

    There are already workarounds that people can use to achieve similar results. That some people consider those workarounds such as replacing a module with another object to be gross is not considered a problem as it is an uncommon need.

    – The 2024 PSC

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    PEPPython Enhancement Proposal

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions