On Tue, Oct 19, 2004 at 11:23:13AM +0200, Leopold Toetsch wrote:* the import statement is simulated too by storing the lexicals into the caller's frame. This would very likely be another Python opcode.
I should point out that this is much more like Python's semantics for "import *" than Dan's overlapping-namespaces idea -- "import" really means "copy these bindings into my current module". In particular, after doing "from foo import *", subsequent additions or removals of names to foo will not be reflected in the bindings of the module importing them.
Right, but the overlapping namespaces stuff isn't for the import.
It's certainly possible that I overestimated the complexity involved in the semantics -- wouldn't be the first time, probably won't be the last. If lexicals actually work just fine for python I'm fine with tossing (or never getting around to implementing) the layered namespace stuff, though if its implemented and never used it has no performance penalties for anything but failed name lookups.
--
Dan
--------------------------------------it's like this------------------- Dan Sugalski even samurai [EMAIL PROTECTED] have teddy bears and even teddy bears get drunk