> > > >>> 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
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
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
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,
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
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
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,
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
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
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://
[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
11 matches
Mail list logo