PyChecker must execute script?
Just
just at xs4all.nl
Thu Feb 6 03:39:13 EST 2003
More information about the Python-list mailing list
Thu Feb 6 03:39:13 EST 2003
- Previous message (by thread): PyChecker must execute script?
- Next message (by thread): Usage Example for Persistent_Id and Persistent_Load of Pickle
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
In article <mailman.1044486616.1085.python-list at python.org>, Trent Mick <trentm at ActiveState.com> wrote: > > > To be more specific. If you put all top-level executing code within a > > > if __name__ == "__main__": > > > # top-level code here > > > block then you will be fine. > > > > A class or def statement is also top-level executing code, as are any > > constant definitions and imports, so this definition is way to strict... > > Unless I have been operating under gross misconceptions only top-level > code and "top-level class code" is executed on module import. For > example: [ snippo ] I think we're talking past one another... I kindof lost track of the context, but I think the OP complained that there was code executing that we didn't want to, while using PyChecker. Then you said he'd be fine if he would put all top-level code in an if __name__ == "__main__" clause. To which I meant to reply that by that definition of top-level code you have to put the entire module inside the if, which renders the module useless... Either I have been totally unclear or I simply misunderstand you. I know we both know how it works, I was just trying to pick nits and failed ;-) Just
- Previous message (by thread): PyChecker must execute script?
- Next message (by thread): Usage Example for Persistent_Id and Persistent_Load of Pickle
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list