jf...@ms4.hinet.net於 2018年12月28日星期五 UTC+8下午4時04分07秒寫道:
> eryk sun at 2018/12/27 UTC+8 PM 6:58:33 wrote:
> > On 12/27/18, jf...@ms4.hinet.net wrote:
> > >
> > > I still don't get it. When I change it to using list comprehension, the
> > > problem is still there. (it now has no late-binding variable
eryk sun at 2018/12/27 UTC+8 PM 6:58:33 wrote:
> On 12/27/18, jf...@ms4.hinet.net wrote:
> >
> > I still don't get it. When I change it to using list comprehension, the
> > problem is still there. (it now has no late-binding variable, right? :-)
> >
> class Too:
> > ... XS = [15, 15, 15,
On Fri, Dec 28, 2018 at 8:47 AM eryk sun wrote:
>
> On 12/27/18, Chris Angelico wrote:
> >
> > Class scope is special, and a generator expression within that class
> > scope is special too. There have been proposals to make these kinds of
> > things less special, but the most important thing to r
On 12/27/18, Chris Angelico wrote:
>
> Class scope is special, and a generator expression within that class
> scope is special too. There have been proposals to make these kinds of
> things less special, but the most important thing to remember is that
> when you create a generator expression, it
On Fri, Dec 28, 2018 at 3:31 AM Ian Kelly wrote:
>
> On Wed, Dec 26, 2018 at 11:21 PM Chris Angelico wrote:
> >
> > On Thu, Dec 27, 2018 at 1:56 PM wrote:
> > >
> > > I saw the code below at stackoverflow. I have a little idea about the
> > > scope of a class, and list comprehension and generat
On Wed, Dec 26, 2018 at 11:21 PM Chris Angelico wrote:
>
> On Thu, Dec 27, 2018 at 1:56 PM wrote:
> >
> > I saw the code below at stackoverflow. I have a little idea about the scope
> > of a class, and list comprehension and generator expressions, but still
> > can't figure out why Z4 works and
On 12/27/18, jf...@ms4.hinet.net wrote:
>
> I still don't get it. When I change it to using list comprehension, the
> problem is still there. (it now has no late-binding variable, right? :-)
>
class Too:
> ... XS = [15, 15, 15, 15]
> ... Z4 = [val for val in XS]
> ... Z5 = [XS[0]
On 12/26/2018 9:53 PM, jf...@ms4.hinet.net wrote:
I saw the code below at stackoverflow. I have a little idea about the scope of
a class, and list comprehension and generator expressions, but still can't
figure out why Z4 works and Z5 not. Can someone explain it? (in a
not-too-complicated way:
eryk sun於 2018年12月27日星期四 UTC+8下午2時31分58秒寫道:
> On 12/26/18, jf...@ms4.hinet.net wrote:
> > I saw the code below at stackoverflow. I have a little idea about the scope
> > of a class, and list comprehension and generator expressions, but still
> > can't figure out why Z4 works and Z5 not. Can someon
On 12/26/18, jf...@ms4.hinet.net wrote:
> I saw the code below at stackoverflow. I have a little idea about the scope
> of a class, and list comprehension and generator expressions, but still
> can't figure out why Z4 works and Z5 not. Can someone explain it? (in a
> not-too-complicated way:-)
>
>
On Thu, Dec 27, 2018 at 1:56 PM wrote:
>
> I saw the code below at stackoverflow. I have a little idea about the scope
> of a class, and list comprehension and generator expressions, but still can't
> figure out why Z4 works and Z5 not. Can someone explain it? (in a
> not-too-complicated way:-)
greetings,
1)
Z4 = sum(val for val in XS)
is same as
Z4 = sum(XS)
2)
class Foo()
can also ne written as
class Foo:
3)
in Foo.x you are using the class just to assoxiate some variables with a
name. what is the purpose of tge script / what are you trying to do?
Abdur-Rahmaan Janhangeer
htt
I saw the code below at stackoverflow. I have a little idea about the scope of
a class, and list comprehension and generator expressions, but still can't
figure out why Z4 works and Z5 not. Can someone explain it? (in a
not-too-complicated way:-)
class Foo():
XS = [15, 15, 15, 15]
Z4 =
13 matches
Mail list logo