20 Mar
2003
20 Mar
'03
11:51 p.m.
Zooko <zooko@zooko.com>:
So your proposal seems sort of like a kind of dynamic scoping for modules
Yes, it would be dynamic scoping of the import namespace. The reason I think it needs to be dynamic rather than lexical is that it isn't really objects or functions that we want to allow or deny capabilities to, it's *users* (for some suitably general notion of "user"). It may be okay for a particular method to do something when it's called by one user, but not another. The current method of controlling access to modules by overriding __import__ suffers from the problem that a given module can only have one __import__ hook at a time. There's no way for different users of the same module to have different importing abilities.