Re: code critique requested - just 60 lines

2008-10-05 Thread Lawrence D'Oliveiro
In message <[EMAIL PROTECTED]>, Terrence Brannon wrote: > On Oct 2, 11:56 am, [EMAIL PROTECTED] wrote: > >> Terrence Brannon, I suggest you to shorten a lot some of those very >> long lines. > > yes, I wanted to, but was not sure how to continue a line on the next > line in Python. Did you check

Re: code critique requested - just 60 lines

2008-10-03 Thread Terrence Brannon
On Oct 2, 11:09 am, Steven D'Aprano <[EMAIL PROTECTED] cybersource.com.au> wrote: > On Thu, 02 Oct 2008 07:51:30 -0700, Terrence Brannon wrote: > > > Basically, using non-strict dictionary keys can lead to bugs, so that > > worried me. > > What's a "non-strict dictionary key"? > In Perl, you can

Re: code critique requested - just 60 lines

2008-10-03 Thread Gabriel Genellina
En Fri, 03 Oct 2008 05:07:41 -0300, Terrence Brannon <[EMAIL PROTECTED]> escribió: On Oct 2, 11:56 am, [EMAIL PROTECTED] wrote: Terrence Brannon, I suggest you to shorten a lot some of those very long lines. yes, I wanted to, but was not sure how to continue a line on the next line in Pytho

Re: code critique requested - just 60 lines

2008-10-03 Thread Terrence Brannon
On Oct 2, 11:56 am, [EMAIL PROTECTED] wrote: > Terrence Brannon, I suggest you to shorten a lot some of those very > long lines. yes, I wanted to, but was not sure how to continue a line on the next line in Python. -- http://mail.python.org/mailman/listinfo/python-list

Re: code critique requested - just 60 lines

2008-10-02 Thread Lie Ryan
On Thu, 02 Oct 2008 07:51:30 -0700, Terrence Brannon wrote: > Hi, I would like some feedback on how you would improve the following > program: > http://www.bitbucket.org/metaperl/ptc_math/src/21979c65074f/payout.py > > Basically, using non-strict dictionary keys can lead to bugs, so that > worrie

Re: code critique requested - just 60 lines

2008-10-02 Thread Steven D'Aprano
On Thu, 02 Oct 2008 07:51:30 -0700, Terrence Brannon wrote: > Hi, I would like some feedback on how you would improve the following > program: > http://www.bitbucket.org/metaperl/ptc_math/src/21979c65074f/payout.py Okay, I've read over the code, and tried to guess from context what it is suppose

Re: code critique requested - just 60 lines

2008-10-02 Thread bearophileHUGS
Terrence Brannon, I suggest you to shorten a lot some of those very long lines. > # http://code.activestate.com/recipes/278259/ > def sumDict(d): > return reduce(lambda x,y:x+y, d.values()) Not all recipes are good, and that looks bad in various ways. Try this: def sumDictValues(d): retu

Re: code critique requested - just 60 lines

2008-10-02 Thread Steven D'Aprano
On Thu, 02 Oct 2008 07:51:30 -0700, Terrence Brannon wrote: > Hi, I would like some feedback on how you would improve the following > program: > http://www.bitbucket.org/metaperl/ptc_math/src/21979c65074f/payout.py Well, for starters, I'd say that's the WORST implementation of Quicksort I've ev