Re: [Python-3000] what do I use in place of reduce?

2008-04-23 Thread Martin v. Löwis
> > > >>> time=1901248 > > > >>> reduce(lambda a, b: a[:-1] + [a[-1]%b, > math.floor(a[-1]/b)], [[time], > > > 60, 60, 24]) > > > [28, 7.0, 0.0, 22.0] # secs, mins, hrs, days > > > > I recommend learning how to use a good old for-loop. That example is > > as c

Re: [Python-3000] what do I use in place of reduce?

2008-04-23 Thread Alex Martelli
On Wed, Apr 23, 2008 at 10:06 PM, Nicholas T <[EMAIL PROTECTED]> wrote: ... > > > > >>> time=1901248 > > > > >>> reduce(lambda a, b: a[:-1] + [a[-1]%b, math.floor(a[-1]/b)], > [[time], > > > > 60, 60, 24]) > > > > [28, 7.0, 0.0, 22.0] # secs, mins, hrs, days ... > It wasn't only posted t

Re: [Python-3000] what do I use in place of reduce?

2008-04-23 Thread Adam Olsen
On Wed, Apr 23, 2008 at 11:06 PM, Nicholas T <[EMAIL PROTECTED]> wrote: > On Wed, Apr 23, 2008 at 9:08 PM, Alex Martelli <[EMAIL PROTECTED]> wrote: > > > > > On Wed, Apr 23, 2008 at 6:47 PM, Guido van Rossum <[EMAIL PROTECTED]> > wrote: > > > On Wed, Apr 23, 2008 at 1:56 PM, Nicholas T <[EMAIL PROT

Re: [Python-3000] what do I use in place of reduce?

2008-04-23 Thread Nicholas T
On Wed, Apr 23, 2008 at 9:08 PM, Alex Martelli <[EMAIL PROTECTED]> wrote: > On Wed, Apr 23, 2008 at 6:47 PM, Guido van Rossum <[EMAIL PROTECTED]> > wrote: > > On Wed, Apr 23, 2008 at 1:56 PM, Nicholas T <[EMAIL PROTECTED]> wrote: > > > > >It's obvious how to use LC's to replace map and filter,

[Python-3000] help() broken?

2008-04-23 Thread Humberto Diogenes
Hi, It seems that help() doesn't work on instances in py3k. Is this what this ticket is about? http://bugs.python.org/issue1883 Python 3.0a4+ (py3k:62469M, Apr 23 2008, 20:46:05) [GCC 4.0.1 (Apple Inc. build 5465)] on darwin Type "help", "copyright", "credits" or "license" for more infor

Re: [Python-3000] what do I use in place of reduce?

2008-04-23 Thread Alex Martelli
On Wed, Apr 23, 2008 at 6:47 PM, Guido van Rossum <[EMAIL PROTECTED]> wrote: > On Wed, Apr 23, 2008 at 1:56 PM, Nicholas T <[EMAIL PROTECTED]> wrote: > > >It's obvious how to use LC's to replace map and filter, but what about > > reduce? It is one of my favorite functions. > > > > >>> time=1

Re: [Python-3000] what do I use in place of reduce?

2008-04-23 Thread Guido van Rossum
On Wed, Apr 23, 2008 at 1:56 PM, Nicholas T <[EMAIL PROTECTED]> wrote: >It's obvious how to use LC's to replace map and filter, but what about > reduce? It is one of my favorite functions. > > >>> time=1901248 > >>> reduce(lambda a, b: a[:-1] + [a[-1]%b, math.floor(a[-1]/b)], [[time], > 60, 60,

Re: [Python-3000] what do I use in place of reduce?

2008-04-23 Thread Greg Ewing
Nicholas T wrote: It's obvious how to use LC's to replace map and filter, but what about reduce? LCs were never intended to be a replacement for reduce. If you like reduce, why not continue to use it? I don't think it's going away, just being moved into a different module. -- Greg

Re: [Python-3000] what do I use in place of reduce?

2008-04-23 Thread Benjamin Peterson
On Wed, Apr 23, 2008 at 3:56 PM, Nicholas T <[EMAIL PROTECTED]> wrote: > Hi all, > >It's obvious how to use LC's to replace map and filter, but what about > reduce? It is one of my favorite functions. It's still there. Just in the functools module! In the future, please ask comp.lang.python o

[Python-3000] what do I use in place of reduce?

2008-04-23 Thread Nicholas T
Hi all, It's obvious how to use LC's to replace map and filter, but what about reduce? It is one of my favorite functions. >>> time=1901248 >>> reduce(lambda a, b: a[:-1] + [a[-1]%b, math.floor(a[-1]/b)], [[time], 60, 60, 24]) [28, 7.0, 0.0, 22.0] # secs, mins, hrs, days Nicholas -- http://

[Python-3000] gettext

2008-04-23 Thread Benjamin Peterson
[I'm not a gettext expert, so sorry if the following is totally wrong. :)] Are we going to want to keep the "u" variants of the gettext APIs around in 3.0? Also, the unicode parameters (for .install methods) don't make much sense in 3.0. I don't see how we could remove them in 3.0, but perhaps re