the.bay.news

PEP 843: Export Statement for DRY Re-exports

Discussions on Python.org
PEP 843: Export Statement for DRY Re-exports
PEP 843 is ready for discussion. It adds a small statement, from x export y [as z], that does what from x import y [as z] does and also appends the name to __all__ in the same statement. # spam/init.py from ._internal.core export PublicAPI from ._internal.widgets export Widget as PublicWidget The problem it targets is narrow: it simplifies “hub modules”. Hub modules are modules whose job is gathering names from internal submodules and re-exposing them. Today that means writing every name twi...

0 comments

Sign in to join the discussion — your thebay.events account works here.

No comments yet.