[triangle-zpug] static list in python
Jim Allman
jim at ibang.com
Fri Mar 14 19:58:35 CET 2008
On Mar 14, 2008, at 2:22 PM, Josh Johnson wrote:
> But remember that everything (seriously, EVERYTHING) about python is
> object oriented. It's hard to avoid it for long...
It might help to think of your Python module as a "singleton" (the
one-and-only instance of its class), and module variable as its
static properties. In your code, this would for all practical
purposes feel like a static var of the class. As with static
properties, the namespace (path to the module or class) helps to
avoid "global soup."
Just keep in mind this cautionary tale of "import myModule" vs. "from
myModule import myVar":
http://www.thescripts.com/forum/thread24318.html
=jimA=
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . .
Jim Allman
Interrobang Digital Media
http://www.ibang.com/
(919) 649-5760
More information about the TriZPUG
mailing list