On Wed, Oct 28, 2009 at 10:40 PM, Imri Goldberg <[email protected]> wrote:
> On Wed, Oct 28, 2009 at 10:30 PM, Amit Aronovitch <[email protected]>wrote: > >> Well, unfortunately I could not come this time as well - so thanks for >> uploading the slides. >> > > You're welcome! > > >> >> Seems like a good selection of topics, also good links for further >> information (hope I get the time to check them out). >> >> One point btw: In the slide about closures, you refer to the "caller's >> variables", which is misleading - the closure actually refers to its >> *enclosing* (or "defining") function's variables. Often this is not the >> function which actually calls it (as can be seen even in your example). >> > > You are correct. I meant what you said, and didn't write it correctly. I > fixed it now and uploaded a new version, thanks! > That's a quick response. kudos :-) > >> p.s.p.s. - actually in this kind of talk I would have probably preferred >> to include another topic or extend more about some already included one than >> discuss closures. This is because it seems to me that programmers usually >> can write such code and guess on their own what it does, even if they never >> stopped to think about how it actually works (it is the implementation that >> is interesting here, and the general issue of lexical scopes, rather than >> the practical uses). >> > > I partially disagree. I don't think it's important to understand closures > in depth for the scope of this presentation. I do think it's important to > know of them to better understand decorators. Since decorators are something > I definitely wanted to include, I added a slide about closures. > During the actual presentation at pywebil, I pretty much skimmed this > subject, made sure people understood the point, and continued to decorators, > the actual practical use. > I see. Seems like I missed the meaning of the cryptic "what is it good for" line ... (Still, your slides are quite understandable stand-alone, which is good. I wouldn't expect anyone to understand anything form one of my own typical presentations without attending the talk ;-) ). Other uses of closures are of course possible, but less important. > > Well, for those of us that had used map+lambda a lot in python1.x (pre- PEP227 days...), scopes and closures might always bring to mind lambda functions ( i.e. avoid need for defining/passing dummy default arguments like so: "map(lambda x,offset=offset: x+offset, my_list)" :-) Of course, introduction of list comprehension in 2.0 also made that usage of closures far less common... Cheers, > Salute, Amit --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "PyWeb-IL" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/pyweb-il?hl=en -~----------~----~----~----~------~----~------~--~---
_______________________________________________ Python-il mailing list [email protected] http://hamakor.org.il/cgi-bin/mailman/listinfo/python-il
