23 Jul
2019
23 Jul
'19
6:15 p.m.
On Jul 23, 2019, at 08:44, Steve Dower
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