[Patches] [Patch #102808] Export control for modules

noreply@sourceforge.net noreply@sourceforge.net
Fri, 05 Jan 2001 21:40:19 -0800


Patch #102808 has been updated. 

Project: python
Category: core (C code)
Status: Open
Submitted by: rumjuggler
Assigned to : gvanrossum
Summary: Export control for modules

Follow-Ups:

Date: 2001-Jan-05 21:40
By: nobody

Comment:
Shouldn't it be called "__all__" (for consistency with a similar
functionality in packages)?
-------------------------------------------------------

Date: 2001-Jan-05 13:20
By: tim_one

Comment:
+1 on the idea, -1 on the patch.  If PyModule_ExportableName is supposed to
be a new part of the public API, we need docs for it; else it should be
renamed (with a leading underscore).

If it is part of the public API, it needs to sanity-check its arguments
(e.g., at least that m and s aren't NULL -- we'll get a core dump now if
they are); else it should at least assert that they're sane.

Needs a test in any case.
-------------------------------------------------------

Date: 2000-Dec-13 05:55
By: gvanrossum

Comment:
Original title was: """modules w/ vbl "__exports__" (lst of strs) have
access ctrl."""

This implements an interesting way of which names are visible outside the
module that defines it: the __exports__ variable contains a list of
exported names.  If it is present, any name not in __exports__ is not
accessible from outside the module (neither through import nor through
direct access (getattr/setattr).

-------------------------------------------------------

-------------------------------------------------------
For more info, visit:

http://sourceforge.net/patch/?func=detailpatch&patch_id=102808&group_id=5470