News for hackers. Stuff that matters.
Re:Introducing PyScript (summary of PyCon keynote) by rjmill on Friday June 24, 2022 @09:08AM (#31861178)
If `apply` is your own code, you could refactor it to

  @apply(lst)
  def naming_is_hard():
      ...
I came to python after working in JS fulltime for years, and used to complain about the exact same thing. After I started using decorators, I stopped complaining about the single-line lambdas.

For any non-python devs looking at my example, it's equivalent to

  def naming_is_hard():
      ...

  naming_is_hard = apply(lst)(naming_is_hard)
It's a nice way to pass functions into other functions, much like how you'd do with a lambda.

edit: s/list/lst/g because autocorrect "fixed" the variable name.

There are no comments on this comment yet.