On May 9, 3:17 pm, [EMAIL PROTECTED] wrote:
> On May 9, 10:11 am, Yves Dorfsman <[EMAIL PROTECTED]> wrote:
>
>
>
>
>
> > [EMAIL PROTECTED] wrote:
> > > The only thing is, is there is another natural meaning to [a,b:c].
>
> > > Counting grids on the diagonals, the rational set is well defined:
>
> >
On May 9, 10:11 am, Yves Dorfsman <[EMAIL PROTECTED]> wrote:
> [EMAIL PROTECTED] wrote:
> > The only thing is, is there is another natural meaning to [a,b:c].
>
> > Counting grids on the diagonals, the rational set is well defined:
>
> > 0: 0, 0
> > 1: 1, 0
> > 2: 0, 1
> > 3: 2, 0
> > 4: 1, 1
> > 5
[EMAIL PROTECTED] wrote:
The only thing is, is there is another natural meaning to [a,b:c].
Counting grids on the diagonals, the rational set is well defined:
0: 0, 0
1: 1, 0
2: 0, 1
3: 2, 0
4: 1, 1
5: 0, 2
6: 3, 0
7: 2, 1
...
Thencefore ( 2, 0 ) : ( 3, 0 ) is well defined. Thencefore,
a,b:
On May 9, 1:23 am, "Ian Kelly" <[EMAIL PROTECTED]> wrote:
> On Wed, May 7, 2008 at 5:29 PM, Yves Dorfsman <[EMAIL PROTECTED]> wrote:
> > Is there a way to do:
> > x = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
> > x[0,2:6]
>
> > That would return:
> > [0, 3, 4, 5, 6]
>
> > I am surprised this notation is not
On Wed, May 7, 2008 at 5:29 PM, Yves Dorfsman <[EMAIL PROTECTED]> wrote:
> Is there a way to do:
> x = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
> x[0,2:6]
>
> That would return:
> [0, 3, 4, 5, 6]
>
> I am surprised this notation is not supported, it seems intuitive.
> A concrete example of the sort of thing
MRAB wrote:
You should've read the thread entitled "Why don't generators execute
until first yield?"! :-) Michael Torrie gave the URL
http://www.dabeaz.com/generators/Generators.pdf. Your example can be
rewritten as follows:
p = file('/etc/passwd') # No need for readlines() because file's
itera
On May 8, 4:34 am, Yves Dorfsman <[EMAIL PROTECTED]> wrote:
> Miles wrote:
> > On Wed, May 7, 2008 at 7:46 PM, Ivan Illarionov
> > > > Is there a way to do:
> > > > x = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
> > > > x[0,2:6]
>
> > > > That would return:
> > > > [0, 3, 4, 5, 6]
>
> Arg... Yes, th
Yves Dorfsman wrote:
So would it be a worthy addition to python, to add it right in the core
of the language, and hopefully in an efficient manner ?
Note that the s[0,2:6] syntax is currently allowed because of the distinct
semantics that the Numeric module and its successors numarray and
On May 7, 11:34 pm, Yves Dorfsman <[EMAIL PROTECTED]> wrote:
> So would it be a worthy addition to python, to add it right in the core of
> the language, and hopefully in an efficient manner ?
Given that it's a straightforward generalization of the existing
slicing syntax, it sure does make sense
Miles wrote:
On Wed, May 7, 2008 at 7:46 PM, Ivan Illarionov
> > Is there a way to do:
> > x = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
> > x[0,2:6]
> >
> > That would return:
> > [0, 3, 4, 5, 6]
Arg... Yes, this is a typo, I meant:
[1, 3, 4, 5, 6]
I think Yves meant to return [1, 3, 4, 5
On May 7, 6:13 pm, Miles <[EMAIL PROTECTED]> wrote:
(snipped)
> I think Yves meant to return [1, 3, 4, 5, 6], as in Perl's list slicing:
>
> my @x = (1, 2, 3, 4, 5, 6, 7, 8, 9, 10);
> return @x[0, 2..6]; // returns (1, 3, 4, 5, 6)
>
> This isn't incredibly efficient, but it does what you want
On Thu, 08 May 2008 01:15:43 +, Ivan Illarionov wrote:
> On Wed, 07 May 2008 21:13:27 -0400, Miles wrote:
>
>> On Wed, May 7, 2008 at 7:46 PM, Ivan Illarionov
>> <[EMAIL PROTECTED]> wrote:
>> > On Wed, 07 May 2008 23:29:27 +, Yves Dorfsman wrote:
>> >
>> > > Is there a way to do:
>>
On Wed, 07 May 2008 21:13:27 -0400, Miles wrote:
> On Wed, May 7, 2008 at 7:46 PM, Ivan Illarionov
> <[EMAIL PROTECTED]> wrote:
> > On Wed, 07 May 2008 23:29:27 +, Yves Dorfsman wrote:
> >
> > > Is there a way to do:
> > > x = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
> > > x[0,2:6]
> > >
>
On Wed, May 7, 2008 at 7:46 PM, Ivan Illarionov
<[EMAIL PROTECTED]> wrote:
> On Wed, 07 May 2008 23:29:27 +, Yves Dorfsman wrote:
>
> > Is there a way to do:
> > x = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
> > x[0,2:6]
> >
> > That would return:
> > [0, 3, 4, 5, 6]
>
> IMHO this notat
On May 7, 6:58 pm, Ivan Illarionov <[EMAIL PROTECTED]> wrote:
> On Wed, 07 May 2008 23:46:33 +, Ivan Illarionov wrote:
> > On Wed, 07 May 2008 23:29:27 +, Yves Dorfsman wrote:
>
> >> Is there a way to do:
> >> x = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
> >> x[0,2:6]
>
> >> That would return:
> >>
On Wed, 07 May 2008 23:46:33 +, Ivan Illarionov wrote:
> On Wed, 07 May 2008 23:29:27 +, Yves Dorfsman wrote:
>
>> Is there a way to do:
>> x = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
>> x[0,2:6]
>>
>> That would return:
>> [0, 3, 4, 5, 6]
>
> IMHO this notation is confusing.
>
> What's wrong
On Wed, 07 May 2008 23:29:27 +, Yves Dorfsman wrote:
> Is there a way to do:
> x = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
> x[0,2:6]
>
> That would return:
> [0, 3, 4, 5, 6]
IMHO this notation is confusing.
What's wrong with:
[0]+x[2:6]
> I am surprised this notation is not supported, it seems
17 matches
Mail list logo