r/Python • • Jul 31 '26

News PEP 842: Module Exports

https://peps.python.org/pep-0842/

Not the author, but this seems interesting, specially for library authors. Thoughts?

Discussion here - https://discuss.python.org/t/pep-842-module-exports/108353

24 Upvotes

44 comments sorted by

View all comments

Show parent comment

1

u/stevenjd Aug 01 '26

when using the Plotly Dash library, the no_update sentinel in callbacks has type NoUpdate, which was gated behind the private module _no_update until version 3.2.0. This meant that to properly type hint my callbacks I had to import from a private module.

You could always do NoUpdate = type(no_update) and no import is necessary.

Even better is to use the name NoUpdateType.