More use cases for one-argument call form functionality.
-
public:()andprivate()now accept a single positional argument, which can be an object imported from another module, a module or submodule, or a string naming any binding at all. The resolved name is added to (or removed from) the__all__of the module where the call appears. -
Backward: incompatible:
public(thing)andprivate(thing)used to operate onsys.modules[thing.__module__], i.e. the module wherethingwas defined. Passing in an imported object therefore added the name to the wrong module's__all__, and in the case ofprivate(), removed it from the wrong module's__all__. Both functions now always use the globals of the module where the call appears. Use as a decorator is unaffected, since a decorator is applied where its target is defined.