Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #25829
| From | Dennis Lee Bieber <wlfraed@ix.netcom.com> |
|---|---|
| Subject | Re: A thread import problem |
| Date | 2012-07-22 17:48 -0400 |
| Organization | > Bestiaria Support Staff < |
| References | (2 earlier) <CA+WuaSc0Rm5s0CXsm7q7-gfyw+jQxpAGkuajpgFyoAHnTP12sQ@mail.gmail.com> <2u8m085co3j3n97jorkl04o5hr1orqb7la@invalid.netcom.com> <CA+WuaSde=GntxGMVTScOUw4_a+jqQS+nme0VpZVgH_219Qo9jA@mail.gmail.com> <5gfm08htgbrum782hfv5fqkb4084qra7vq@invalid.netcom.com> <CA+WuaScB1jycdBNPosEePGUX=8n80Wst3tGv672TK2FVq-KAig@mail.gmail.com> |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.2441.1342993706.4697.python-list@python.org> (permalink) |
On Sun, 22 Jul 2012 13:04:25 -0600, Bruce Sherwood
<bruce.sherwood@gmail.com> declaimed the following in
gmane.comp.python.general:
> Another way of saying this is that I'm not building an app, in which
> case I would structure things in a simple and straightforward manner.
> I am instead trying to maintain and update a library that allows
> novice programmers to write programs that generate real-time navigable
> 3D animations, writing minimalist programs that work cross-platform.
>
I suspect you don't need to update the library so much as enforce a
project style that prevents your import-thread-import cycle. In short,
something like that hypothetical "runner()" design.
Oh, and document that style in detail: "importable modules shall
only perform module level definition of entities during import -- no
code that actually processes data"; "importable modules shall make use
of the 'if __name__ == "__main__": main()' convention to identify when
the module is being used stand-alone, and thereby invoke the main
processing; otherwise the module.main() function is to be invoked only
be the module doing the imports, after the import has completed"
etc.
--
Wulfraed Dennis Lee Bieber AF6VN
wlfraed@ix.netcom.com HTTP://wlfraed.home.netcom.com/
Back to comp.lang.python | Previous | Next | Find similar | Unroll thread
Re: A thread import problem Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2012-07-22 17:48 -0400
csiph-web