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
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
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
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
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
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
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
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
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
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
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}
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
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
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
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
15 matches
Mail list logo