[EMAIL PROTECTED] wrote:
> Is there any chance of itertools.count() ever becoming one of the
> built-in functions?
That's unlikely. The goal is to have fewer builtins rather than more.
Utility and frequency are not the only considerations; otherwise
glob.glob, sys.stderr, print.pprint, copy.copy,
Duncan Smith <[EMAIL PROTECTED]> wrote:
> [EMAIL PROTECTED] wrote:
> > Zipping an xrange? I'm having trouble visualizing how you do that to
> > avoid x*i+y.
> >
> > -Janto
> >
>
> Something like,
>
> >>> lis = ['a', 'b', 'c', 'd']
> >>> y = 3
> >>> i = 7
> >>> for n, item in zip(xrange(y, len
[EMAIL PROTECTED] wrote:
> Zipping an xrange? I'm having trouble visualizing how you do that to
> avoid x*i+y.
>
> -Janto
>
Something like,
>>> lis = ['a', 'b', 'c', 'd']
>>> y = 3
>>> i = 7
>>> for n, item in zip(xrange(y, len(lis)*i+y, i), lis):
print n, item
3 a
10 b
17 c
Zipping an xrange? I'm having trouble visualizing how you do that to
avoid x*i+y.
-Janto
--
http://mail.python.org/mailman/listinfo/python-list
Oops. The messed-up version wasn't supposed to be messed-up. Two
mistakes on one line. Which kinda proves my point :)
I'd much rather use the count version than (1) or (2). (1) has the
problem of having "incorrect" values the rest of the time in the loop
and (2) is going to an extreme just to avoi
On 29/05/2006 9:50 AM, [EMAIL PROTECTED] wrote:
> I have a project of around 6000 lines where I used count() 20 times. It
> has 14 modules, 10 of which I needed an explicit import.
>
> Many of the usages are of the form:
>
> for item, n in zip(items, count(N)):
> dostuff
>
> Around half of thes
[EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> I have a project of around 6000 lines where I used count() 20 times. It
> has 14 modules, 10 of which I needed an explicit import.
>
> Many of the usages are of the form:
>
> for item, n in zip(items, count(N)):
> dostuff
>
> Around half of these
Oh and I use repeat, chain and cycle quite a bit. But I don't mind
importing them as they are usually limited to one module.
--
http://mail.python.org/mailman/listinfo/python-list
I have a project of around 6000 lines where I used count() 20 times. It
has 14 modules, 10 of which I needed an explicit import.
Many of the usages are of the form:
for item, n in zip(items, count(N)):
dostuff
Around half of these are due to using pylab.subplot(x,y.n), which
requires values for
On 29/05/2006 4:14 AM, [EMAIL PROTECTED] wrote:
> Is there any chance of itertools.count() ever becoming one of the
> built-in functions? It's a wonderful little function and I find myself
> importing it in every module I write.
>
Every module?? Do you use any/many other itertools functions? Care
Is there any chance of itertools.count() ever becoming one of the
built-in functions? It's a wonderful little function and I find myself
importing it in every module I write.
-Janto
--
http://mail.python.org/mailman/listinfo/python-list
11 matches
Mail list logo