More use cases for one-argument call form functionality.

  • public:() and private() 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) and private(thing) used to operate on sys.modules[thing.__module__], i.e. the module where thing was defined. Passing in an imported object therefore added the name to the wrong module's __all__, and in the case of private(), 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.

Merge request reports

Loading
Loading