Re: Py 3 slower than Py 2. Towers of Hanoi implementation

2009-06-26 Thread Udyant Wig
On Jun 26, 8:01 pm, Paul Moore wrote: > 2009/6/26 Udyant Wig : > > > > > > > I implemented this ->http://www.apl.jhu.edu/~hall/lisp/Hanoi.lispin > > both flavors of Python: 2.6.2 and 3.0.1 (CPython) > > > The code: > > #!/usr/bin/env python > > def remaining_peg (peg1, peg2): > >        return (6

Re: Py 3 slower than Py 2. Towers of Hanoi implementation

2009-06-26 Thread Paul Moore
2009/6/26 Udyant Wig : > I implemented this -> http://www.apl.jhu.edu/~hall/lisp/Hanoi.lisp in > both flavors of Python: 2.6.2 and 3.0.1 (CPython) > > The code: > #!/usr/bin/env python > def remaining_peg (peg1, peg2): >        return (6 - peg1 - peg2) > > def hanoi (num_discs, start, end): >      

Re: Py 3 slower than Py 2. Towers of Hanoi implementation

2009-06-26 Thread Udyant Wig
On Jun 26, 7:14 pm, Stefan Behnel wrote: > Udyant Wig wrote: > > I implemented this ->http://www.apl.jhu.edu/~hall/lisp/Hanoi.lispin > > both flavors of Python: 2.6.2 and 3.0.1 (CPython) > > > The code: > > #!/usr/bin/env python > > def remaining_peg (peg1, peg2): > >    return (6 - peg1 - peg2) >

Re: Py 3 slower than Py 2. Towers of Hanoi implementation

2009-06-26 Thread Stefan Behnel
Udyant Wig wrote: > I implemented this -> http://www.apl.jhu.edu/~hall/lisp/Hanoi.lisp in > both flavors of Python: 2.6.2 and 3.0.1 (CPython) > > The code: > #!/usr/bin/env python > def remaining_peg (peg1, peg2): > return (6 - peg1 - peg2) > > def hanoi (num_discs, start, end): > if

Py 3 slower than Py 2. Towers of Hanoi implementation

2009-06-26 Thread Udyant Wig
I implemented this -> http://www.apl.jhu.edu/~hall/lisp/Hanoi.lisp in both flavors of Python: 2.6.2 and 3.0.1 (CPython) The code: #!/usr/bin/env python def remaining_peg (peg1, peg2): return (6 - peg1 - peg2) def hanoi (num_discs, start, end): if (1 == num_discs):