thread problem

gvwilson at nevex.com gvwilson at nevex.com
Mon Feb 28 22:10:51 EST 2000


> It's trivial <wink>.

How did I know someone was going to say that?

> evaluate() *does* set self.result, but look at how you invoke it:
> >         self.result = self.evaluate()
> Your evaluate() method doesn't have a "return" stmt, it just falls off
> the end.  So evaluate() returns None, which you immediately write over
> the correct self.result.

*sigh*  Thanks --- here's me thinking complicated, and it's simple.  Don't
suppose there'll be a warning option in 1.6 for this kind of thing?

> BTW, think about using the threading module instead, and using a
> threading.Event object.  It's much less error-prone than using the
> thread module and a raw mutex.

Figured I'd start low-level, then move up, then do some timings.

Next: active expressions!

Thanks,
Greg





More information about the Python-list mailing list