> > Hey, > > I am intrigued by the comments about lambdas here. Is it really necessary > to teach them as part of a (beginners?) Python course? >
I agree that teaching lambdas as in **teaching lambdas** is not necessary. But teaching beginners how to defend themselves from lambdas, that will find in code everywhere, is important. I always taught students to "see" a `def` function in lambdas and re-write them as such. BTW the new pep8 checker recommends exactly that: http://pep8.readthedocs.org/en/latest/intro.html (E731) -Filipe > I understand the benefits of lambdas and use them heavily myself, but > anything you can do with a lambda, you can do with a traditional function. > Given that you can't use statements in a lambda and the scoping rules are > counter intuitive, isn't it better to leave them out when doing such a > course? > > Has anyone here ever taught lambdas as part of a SWC workshop? > > Cheers, > Ewan > > > On Tue, Mar 3, 2015 at 10:47 PM, David Martin (Staff) < > [email protected]> wrote: > >> >> >> >> >> *From:* Discuss [mailto:[email protected]] *On >> Behalf Of *Lex Nederbragt >> *Sent:* 03 March 2015 11:34 >> *To:* Software Carpentry Discussion >> *Subject:* [Discuss] Python for biologists: Five things I hate about >> teaching Python >> >> >> >> Hi, >> >> >> >> I just found this post that some people may appreciate: >> http://pythonforbiologists.com/index.php/five-things-i-hate-about-teaching-python/ >> >> >> >> Lex >> >> >> >> And as is typical it gets a load of programming solutions when what is >> needed are teaching solutions. Who thinks that inundating students with >> closures, context managers etc on their first day in dealing with >> programming is a good idea? Likewise ‘just copy this, it is magic and will >> do what you want’ is also deeply unsatisfactory. >> >> >> >> ..d >> >> The University of Dundee is a registered Scottish Charity, No: SC015096 >> > > > _______________________________________________ > Discuss mailing list > [email protected] > > http://lists.software-carpentry.org/mailman/listinfo/discuss_lists.software-carpentry.org >
_______________________________________________ Discuss mailing list [email protected] http://lists.software-carpentry.org/mailman/listinfo/discuss_lists.software-carpentry.org
