Re: A question on python performance.

2007-09-28 Thread Magnus Lycka
Joe Goldthwaite wrote: > I didn't know about the getattr function. I tried to search for that > type of function but not knowing how to word the search request, > I couldn't find it. You should really read through chapter 2 (Built-in Objects) of the library reference. All that stuff is core Pytho

Re: A question on python performance.

2007-09-28 Thread Bruno Desthuilliers
Joe Goldthwaite a écrit : (snip) > I guess I still think of decorators as the people > who got the gym ready for the prom. I've tried getting up to speed on > decorators but I haven't had much success. The @decorator syntax is just syntactic sugar for a common use of higher order functions. So

RE: A question on python performance.

2007-09-27 Thread Joe Goldthwaite
[EMAIL PROTECTED] wrote: >Makes perfect sense to me! Think about it: > >method 1: looks up the method directly from the object (fastest) >method 2: looks up __class__, then looks up __dict__, then gets the >element from __dict__ >method 3: looks up caller, looks up __class__, looks up __dict__, ge

Re: A question on python performance.

2007-09-26 Thread Bruno Desthuilliers
Joe Goldthwaite a écrit : > Hi everyone, > > I'm a developer who's been using python for a couple of years. I wrote a > fairly large application using it but I was learning the language at the > same time so it most of the code kind of sucks. > > I've learned a lot since then and I've been going

Re: A question on python performance.

2007-09-26 Thread Paul Hankin
On Sep 26, 7:26 pm, "Joe Goldthwaite" <[EMAIL PROTECTED]> wrote: > The code gets kind of wordy so I started trying to figure out how to call > them dynamically since the param type is the same as the method the > retrieves it. I came up with this; > > def getValue(trend, param, per): >return t

Re: A question on python performance.

2007-09-26 Thread Erik Jones
On Sep 26, 2007, at 1:26 PM, Joe Goldthwaite wrote: > Hi everyone, > > I'm a developer who's been using python for a couple of years. I > wrote a > fairly large application using it but I was learning the language > at the > same time so it most of the code kind of sucks. > > I've learned a l

Re: A question on python performance.

2007-09-26 Thread chris . monsanto
On Sep 26, 2:26 pm, "Joe Goldthwaite" <[EMAIL PROTECTED]> wrote: > Hi everyone, > > I'm a developer who's been using python for a couple of years. I wrote a > fairly large application using it but I was learning the language at the > same time so it most of the code kind of sucks. > > I've learned

A question on python performance.

2007-09-26 Thread Joe Goldthwaite
Hi everyone, I'm a developer who's been using python for a couple of years. I wrote a fairly large application using it but I was learning the language at the same time so it most of the code kind of sucks. I've learned a lot since then and I've been going through my code trying to organize it b