weakref, memory management and execution slow down in PyQt4
Mark Lawrence
breamoreboy at yahoo.co.uk
Tue Sep 9 03:43:29 EDT 2014
On 09/09/2014 03:45, kjs wrote:
>
> You're right, a dictionary can do everything I need and more. This
> happened to be the first thing I thought of, and I didn't imagine it
> would be very expensive. I figured it was simply a different way of
> defining and retrieving a class variable. IE setattr(self, foo, True) ==
> self.foo = True.
>
My rule of thumb for making a judgement on Python performance is never
assume anything, ever. In using Python for well over 10 years my gut
instinct has never been correct on this matter. The only thing to do is
profile your code and then seek the answers online, as you can guarantee
someone else has already been there, seen it, done it and got the t-shirt :)
--
My fellow Pythonistas, ask not what our language can do for you, ask
what you can do for our language.
Mark Lawrence
More information about the Python-list
mailing list