modutil icon indicating copy to clipboard operation
modutil copied to clipboard

Proxy module attributes through to __spec__

Open brettcannon opened this issue 8 years ago • 0 comments

I.e. remove __file__, __cached__, __package__, and __loader__ from a module and proxy their accesses through to the underlying __spec__ object. Provides another way to minimize the attributes exposed on a module.

Deleting __name__ and __path__ is probably a bad idea since too much code out there assuming those attributes are set at the global level of a module.

brettcannon avatar Apr 23 '18 00:04 brettcannon