[Python-ideas] Does jargon make learning more difficult?

David Mertz mertz at gnosis.cx
Wed Aug 22 16:24:09 EDT 2018


Oops. I blame the partial editing of copy/padte on doing it on my phone. I
meant this, of course:

widget.register(callback=spam.eggs)

On Wed, Aug 22, 2018, 1:47 PM Steven D'Aprano <steve at pearwood.info> wrote:

> On Wed, Aug 22, 2018 at 01:38:03PM -0400, David Mertz wrote:
> > On Wed, Aug 22, 2018, 12:40 PM Steven D'Aprano <steve at pearwood.info>
> wrote:
> >
> > > I believe that many people have a lot of trouble grasping the concept
> of
> > > functions as first-class values capable of being passed to other
> functions
> > > as data... It took me a long time to stop writing code like this:
> > >
> > >     map(lambda x: len(x), sequence)
> > >
> > > instead of simply map(len, sequence).
> > >
> >
> > That long time is ongoing :-)
> >
> > You recently wrote in another thread:
> >
> >    widget.register(callback=lambda: spam.eggs())
>
> Hah, so I did.
>
>
> > Instead of the slightly faster and definitely more direct:
> >
> >   widget.register(callback=spam.eggs())
>
> Except that doesn't work, since you are passing the result of calling
> spam.eggs as the callback, instead of spam.eggs itself :-)
>
>
>
> --
> Steve
> _______________________________________________
> Python-ideas mailing list
> Python-ideas at python.org
> https://mail.python.org/mailman/listinfo/python-ideas
> Code of Conduct: http://python.org/psf/codeofconduct/
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20180822/b59e75d6/attachment.html>


More information about the Python-ideas mailing list