Which class's comparison function is called?

2007-06-05 Thread Bill Jackson
For example, class A: def __init__(self,a): self.a = a def __eq__(self, other): return self.a == other.a class B: def __init__(self,b): self.b = b def __eq__(self, other): return self.b == other.b A(1) == B(1) ---> AttributeError: B instance has no attribute a B

Re: matplotlib, usetex

2007-05-26 Thread Bill Jackson
Alexander Schmolck wrote the following on 05/25/2007 02:33 PM: > I have no idea whether this will resolve your problem, but you could try > updating to 0.90 (BTW what happens if you do axis([0,128,0,128])). The problem appears to be with a matplotlibrc file. If I delete the matplotlibrc file, th

Re: matplotlib, usetex

2007-05-25 Thread Bill Jackson
Alexander Schmolck wrote the following on 05/25/2007 02:33 PM: > (BTW what happens if you do axis([0,128,0,128])). In [1]: import pylab In [2]: pylab.axis([0,128,0,128]) In [3]: pylab.show() --- Traceback (most recent cal

matplotlib, usetex

2007-05-25 Thread Bill Jackson
Hi, I'm having some trouble plotting with the following matplotlibrc: text.usetex : True I tried clearing the cache files under ~/.matplotlib, but this did not help the problem. I'd post on the matplotlib mailing list, but I have a hard enough time browsing sourceforge's achives (frequen

Re: Import Problems

2007-04-27 Thread Bill Jackson
Bill Jackson wrote the following on 04/27/2007 12:49 PM: > # importtest/test2/__init__.py > from someclass import * > from test2 import * Sorry typo here: # importtest/test2/__init__.py from someclass import * from mytest import * -- http://mail.python.org/mailman/listinfo/python-list

Import Problems

2007-04-27 Thread Bill Jackson
Once again, I am having issues with imports... Until now, I thought the general guidelines were to rarely use 'from x import y' syntax, except when you really want to copy names over. However, I have run into issues by following this guideline. So... 1) What is going wrong in the example below

Re: Preferred Random Library

2007-04-25 Thread Bill Jackson
Paul Rubin wrote the following on 04/25/2007 10:17 PM: > Bill Jackson <[EMAIL PROTECTED]> writes: >> Is there a preferred random library? > > Preferred for what? Maybe you want os.urandom(). How about for general usage...I am just asking for a very broad descript

random.py

2007-04-25 Thread Bill Jackson
In random.py (Python 2.5.1), line 86 says: VERSION = 2# used by getstate/setstate Then, in the definition of Random.setstate, we have: if version == 2: Why is it not: if version == self.VERSION: -- http://mail.python.org/mailman/listinfo/python-list

Preferred Random Library

2007-04-25 Thread Bill Jackson
Is there a preferred random library? scipy.random random Besides scipy's library returning ndarrays, is there any other advantage/disadvantage? -- http://mail.python.org/mailman/listinfo/python-list

Re: When to clear a dictionary...

2007-04-20 Thread Bill Jackson
Bill Jackson wrote the following on 04/20/2007 09:48 AM: > >>> import some_function > > >>> a = {1:2,3:4} > >>> b = {1:2:4:3} > >>> a.clear() > >>> a.update(b) > > >>> a = {1:2,3:4} > >>> b = {1

When to clear a dictionary...

2007-04-20 Thread Bill Jackson
What is the benefit of clearing a dictionary, when you can just reassign it as empty? Similarly, suppose I generate a new dictionary b, and need to have it accessible from a. What is the best method, under which circumstances? >>> import some_function >>> a = {1:2,3:4} >>> b = {1:2:4:3}

Re: Better dict of dicts

2007-04-19 Thread Bill Jackson
Martin v. Löwis wrote the following on 04/19/2007 02:43 PM: > Bill Jackson schrieb: >> I have a dictionary of dictionaries where the keys are typically very >> long tuples and repeated in each inner dictionary. > > What I don't understand here: you say the keys are tup

Better dict of dicts

2007-04-19 Thread Bill Jackson
I have a dictionary of dictionaries where the keys are typically very long tuples and repeated in each inner dictionary. The dictionary representation is nice because it handles sparseness well...and it is nice to be able to look up values based on a string rather than a number. However, sinc

Re: Why does wx.Window.CaptureMouse() send EVT_PAINT

2006-12-12 Thread Bill Jackson
Tim Roberts wrote the following on 12/09/2006 08:27 PM: > The source code could answer that question for sure, but I doubt that it is > CaptureMouse doing it, and I know the SetCapture API (which it eventually > calls) does not. Is it possible that your clicking caused some part of the > app to be

Why does wx.Window.CaptureMouse() send EVT_PAINT

2006-12-07 Thread Bill Jackson
It seems that the CaptureMouse method sends an EVT_PAINT handler. The documentation does not mention this...is it somewhere else? Could someone explain why this handler is sent out? Also, I've seen: def OnMouseDown(self, evt): self.CaptureMouse() self.x, self.y = self.l