glyph/publication

@published decorator?

Closed this issue · 2 comments

Have you thought about offering a decorator, which would manage __all__ for me?

glyph commented

Indeed I have!

In fact this is the interface that I would (eventually) prefer.

There are other packages that do this: https://pypi.org/project/public/ https://pypi.org/project/atpublic/ https://pypi.org/project/publicize/

The problem, however, is that no other software pays attention to @public decorators.

In particular, here are some packages I care about that interact with __all__:

since it's a widely-respected convention, it's honored by a big long tail of other packages:

Many of these tools statically read __all__ with ast.literal_eval or similar, and therefore depend on it being directly present at compile time, not runtime.

As such, for the time being, until we have some way to make all these tools respect the (much nicer!) @public decorator, we'll stick with __all__.

glyph commented

Closing for now, but if someone wants to undertake the work to make this "long tail" work with publication-ized packages, we could consider reopening.