
July 23, 2019
11:15 a.m.
On Jul 23, 2019, at 08:44, Steve Dower <steve.dower@python.org> wrote:
The @public decorator is basically:
def public(fn): __all__.append(fn.__name__) return fn
It's trivial, but it adds a runtime overhead that is also trivially avoided by putting the name in __all__ manually. And once it's public API, we shouldn't be making it too easy to rename the function anyway ;)
My package has a C version. If public() were a builtin (which I’ve implemented) it wouldn’t have that much import time overhead. -Barry