name of client module

Jeff Schwab jeff at schwabcenter.com
Mon Feb 18 22:10:23 EST 2008


Nick Stinemates wrote:
>> I'm not saying I don't want to do that.  I'm saying that, in addition to 
>> what you've written, I want foo to know it's being imported, and by whom.

Please don't snip so much.

> You're still not explaining a real example of what this could be used for.

Why would you say something like that?  I told you *exactly* what I 
wanted to use it for.  See Berwyn's post on the recent thread "Double 
underscores -- ugly?"  He suggests that a suitable replacement for "if 
__name__ == '__main__'" might be "if sys.main()".  I was looking for a 
way to implement that kind of function.  Just like I told you when you 
asked me.  You snipped it, along with most of the post.

> Oh well, here's an example of an implementation of what you want to do.

Thanks.



More information about the Python-list mailing list