2.1.1 global weirds

Robin Becker robin at jessikat.fsnet.co.uk
Sun Aug 12 08:52:09 EDT 2001


In article <9l5ql10sbt at enews4.newsguy.com>, Alex Martelli
<aleaxit at yahoo.com> writes
....
>
>These are not modules that run unit tests when run as main scripts.
>
>> I consider that a bit strange since it seems that the special case of
>> main script circularity is harder to detect/avoid; I believe that's
>> onlyc caused by the special module name.
>
>The special module name 'half-breaks' circularity, just enough to
>let you run unit tests decently.

well if the name were kept the same and my special magic __main__
variable worked that wouldn't be required, so we would have clarity and
functionality. However, I feel that the real underlying problem is that
it is possible for the same module level code to have two different
module names and that this is the real ambiguity.

There's probably some reason for allowing A.B and B to have the same
module source and be different modules, but I don't know what it is. The
same is true for the __main__ module it's probably too difficult to work
out what the true module name should be.
-- 
Robin Becker



More information about the Python-list mailing list