On Thu, Sep 1, 2022 at 9:16 AM Chris Angelico wrote:
> On Fri, 2 Sept 2022 at 02:10, James Tsai wrote:
> >
> > Hello,
> >
> > I find it very useful if I am allowed to define new local variables in a
> list comprehension. For example, I wish to have something like
> > [(x, y) for x in range(10) f
在 2022年9月2日星期五 UTC+2 00:17:23, 写道:
> On 02Sep2022 07:01, Chris Angelico wrote:
> >On Fri, 2 Sept 2022 at 06:55, James Tsai wrote:
> >> No but very often when I have written a neat list/dict/set
> >> comprehension, I find it very necessary
> >> to define local variable(s) to make it more clear
Dumb question. Your y is purely a function of x. So create an f(x) where
you want your y. It probably can even be anonymous inline. I mean your
return values of (x, y) would be (x, f(x)) ...
On Thu, Sep 1, 2022, 5:04 PM Chris Angelico wrote:
> On Fri, 2 Sept 2022 at 06:55, James Tsai wrote:
> >
On 02Sep2022 07:01, Chris Angelico wrote:
>On Fri, 2 Sept 2022 at 06:55, James Tsai wrote:
>> No but very often when I have written a neat list/dict/set
>> comprehension, I find it very necessary
>> to define local variable(s) to make it more clear and concise. Otherwise I
>> have to break it d
On 2022-09-01 13:33:16 -0700, James Tsai wrote:
> 在 2022年9月1日星期四 UTC+2 18:34:36, 写道:
> > On 9/1/22, James Tsai wrote:
> > >
> > > I find it very useful if I am allowed to define new local variables in a
> > > list comprehension. For example, I wish to have something like
> > > [(x, y) for x in
On Fri, 2 Sept 2022 at 06:55, James Tsai wrote:
>
> 在 2022年9月1日星期四 UTC+2 18:34:36, 写道:
> > On 9/1/22, James Tsai wrote:
> > >
> > > I find it very useful if I am allowed to define new local variables in a
> > > list comprehension. For example, I wish to have something like
> > > [(x, y) for x in
在 2022年9月1日星期四 UTC+2 18:16:03, 写道:
> On Fri, 2 Sept 2022 at 02:10, James Tsai wrote:
> >
> > Hello,
> >
> > I find it very useful if I am allowed to define new local variables in a
> > list comprehension. For example, I wish to have something like
> > [(x, y) for x in range(10) for y := x **
在 2022年9月1日星期四 UTC+2 18:34:36, 写道:
> On 9/1/22, James Tsai wrote:
> >
> > I find it very useful if I am allowed to define new local variables in a
> > list comprehension. For example, I wish to have something like
> > [(x, y) for x in range(10) for y := x ** 2 if x + y < 80], or
> > [(x, y) f
在 2022年9月1日星期四 UTC+2 16:15:17, 写道:
> James Tsai writes:
>
> > I find it very useful if I am allowed to define new local variables in
> > a list comprehension. For example, I wish to have something like
> > [(x, y) for x in range(10) for y := x ** 2 if x + y < 80], or
> > [(x, y) for x in rang
On 9/1/22, James Tsai wrote:
>
> I find it very useful if I am allowed to define new local variables in a
> list comprehension. For example, I wish to have something like
> [(x, y) for x in range(10) for y := x ** 2 if x + y < 80], or
> [(x, y) for x in range(10) with y := x ** 2 if x + y < 80].
>
On Fri, 2 Sept 2022 at 02:10, James Tsai wrote:
>
> Hello,
>
> I find it very useful if I am allowed to define new local variables in a list
> comprehension. For example, I wish to have something like
> [(x, y) for x in range(10) for y := x ** 2 if x + y < 80], or
> [(x, y) for x in range(10) wit
James Tsai writes:
> I find it very useful if I am allowed to define new local variables in
> a list comprehension. For example, I wish to have something like
> [(x, y) for x in range(10) for y := x ** 2 if x + y < 80], or
> [(x, y) for x in range(10) with y := x ** 2 if x + y < 80].
>
> For now
Hello,
I find it very useful if I am allowed to define new local variables in a list
comprehension. For example, I wish to have something like
[(x, y) for x in range(10) for y := x ** 2 if x + y < 80], or
[(x, y) for x in range(10) with y := x ** 2 if x + y < 80].
For now this functionality can
13 matches
Mail list logo