another thread on Python threading

cgwalters at gmail.com cgwalters at gmail.com
Mon Jun 4 00:07:52 CEST 2007


On Jun 3, 5:52 pm, Steve Howell <showel... at yahoo.com> wrote:

> The pitfall here is that to reduce code duplication,
> you might initialize certain variables in a method
> called by __init__, because your object might want to
> return to its initial state.

This is a good point.  I was thinking that this analysis would
occur during module loading; i.e. it would be the equivalent of Java's
classloading.

What if the startup code analysis just extended to methods called
during __init__?
That seems like a relatively straightforward extension.  Remember we
aren't actually *executing*
the startup code in my proposal; we are just analyzing it for all
possible execution paths which cause
a member variable assignment.




More information about the Python-list mailing list