Re: stackless and pickling functions/lambdas
lars van Gemerden <[email protected]> Wed, 20 Aug 2014 12:58:11 +0200
| Newsgroups | gmane.comp.python.stackless |
|---|---|
| Message-ID | <CAP8kt8x=z67JQFO+A+zgNgaKGWOmxR4_t1Jo+UHUHS9SSk8L6Q@mail.gmail.com> |
--===============4177863867521540744== Content-Type: multipart/alternative; boundary=089e013d15d4e5b3a905010d7a6a --089e013d15d4e5b3a905010d7a6a Content-Type: text/plain; charset=UTF-8 Yes i tested it; just wanted to verify that is was stackless that made pickling of function bodies possible, without installing non-stackless python. Also it's impossible to test the general case. Cheers, Lars On Mon, Aug 18, 2014 at 10:25 PM, Richard Tew <[email protected]> wrote: > Did you test it? Lars, please, if you can test something with code, > you'll find out the answer faster than asking on the mailing list. > > On 8/18/14, lars van Gemerden <[email protected]> wrote: > > Hi, > > > > I have a short question: does the ability for stackless to pickle > tasklets > > also mean that it can pickle functions and lambda's? > > > > as in: > > > > import cPickle as pickle > > > > if __name__ == "__main__": > > s = pickle.dumps(lambda x, y: x+y) > > f = pickle.loads(s) > > assert f(3,4) == 7 > > > > Cheers, Lars > > -- > > ==================================== > > Lars van Gemerden > > [email protected] > > +31 6 26 88 55 39 > > ==================================== > > > > _______________________________________________ > Stackless mailing list > [email protected] > http://www.stackless.com/mailman/listinfo/stackless > -- ==================================== Lars van Gemerden [email protected] +31 6 26 88 55 39 ==================================== --089e013d15d4e5b3a905010d7a6a Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable <div dir=3D"ltr">Yes i tested it; just wanted to verify that is was stackle= ss that made pickling of function bodies possible, without installing non-s= tackless python. Also it's impossible to test the general case.<div><br= > </div><div>Cheers, Lars=C2=A0</div></div><div class=3D"gmail_extra"><br><br= ><div class=3D"gmail_quote">On Mon, Aug 18, 2014 at 10:25 PM, Richard Tew <= span dir=3D"ltr"><<a href=3D"mailto:[email protected]" target=3D"_= blank">[email protected]</a>></span> wrote:<br> <blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p= x #ccc solid;padding-left:1ex">Did you test it?=C2=A0 Lars, please, if you = can test something with code,<br> you'll find out the answer faster than asking on the mailing list.<br> <div><div class=3D"h5"><br> On 8/18/14, lars van Gemerden <<a href=3D"mailto:[email protected]">l= [email protected]</a>> wrote:<br> > Hi,<br> ><br> > I have a short question: does the ability for stackless to pickle task= lets<br> > also mean that it can pickle functions and lambda's?<br> ><br> > as in:<br> ><br> > import cPickle as pickle<br> ><br> > if __name__ =3D=3D "__main__":<br> >=C2=A0 =C2=A0 =C2=A0s =3D pickle.dumps(lambda x, y: x+y)<br> >=C2=A0 =C2=A0 =C2=A0f =3D pickle.loads(s)<br> >=C2=A0 =C2=A0 =C2=A0assert f(3,4) =3D=3D 7<br> ><br> > Cheers, Lars<br> > --<br> > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D<br> > Lars van Gemerden<br> > <a href=3D"mailto:[email protected]">[email protected]</a><br> > <a href=3D"tel:%2B31%206%2026%2088%2055%2039" value=3D"+31626885539">+= 31 6 26 88 55 39</a><br> > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D<br> ><br> <br> </div></div>_______________________________________________<br> Stackless mailing list<br> <a href=3D"mailto:[email protected]">[email protected]</a><br> <a href=3D"http://www.stackless.com/mailman/listinfo/stackless" target=3D"_= blank">http://www.stackless.com/mailman/listinfo/stackless</a><br> </blockquote></div><br><br clear=3D"all"><div><br></div>-- <br>=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D<br>Lars van Gemerden<br><a href=3D"mailto:lars@ration= al-it.com">[email protected]</a><br>+31 6 26 88 55 39<br>=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D </div> --089e013d15d4e5b3a905010d7a6a-- --===============4177863867521540744== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Stackless mailing list [email protected] http://www.stackless.com/mailman/listinfo/stackless --===============4177863867521540744==--