Ponder.cat
  • Communities
  • heart
  • search
    • Login
    • Sign Up
    • Communities

    • heart
      Support Lemmy
    • search
      Search

    • Login
    • Sign Up
    bestelbus22@lemmy.world to Programmer Humor@lemmy.mlEnglish · 16 days ago

    The meaning of this

    lemmy.ml

    message-square
    71
    fedilink
    526

    The meaning of this

    lemmy.ml

    bestelbus22@lemmy.world to Programmer Humor@lemmy.mlEnglish · 16 days ago
    message-square
    71
    fedilink
    • jacksilver@lemmy.world
      link
      fedilink
      arrow-up
      18
      ·
      16 days ago

      Maybe I’m missing something, but:

      • Python Lambda Functions - https://www.w3schools.com/python/python_lambda.asp
      • Python map - https://www.geeksforgeeks.org/python-map-function/
        • They do have list comprehension, which let you basically one line a map operation more intuitively too.
      • wewbull@feddit.uk
        link
        fedilink
        English
        arrow-up
        16
        ·
        16 days ago

        So much Python criticism comes from people who don’t know the language.

        • jacksilver@lemmy.world
          link
          fedilink
          arrow-up
          5
          ·
          16 days ago

          I mean, there is a lot wrong with it, but every language has its quirks. Generally I like discussing it’s actual flaws cause it helps me better understand the language.

      • Natanox@discuss.tchncs.de
        link
        fedilink
        English
        arrow-up
        6
        ·
        edit-2
        16 days ago

        And switch cases (called match cases) are there as well.

        I use lambdas all the time to shovel GTK signal emitions from worker threads into GLib.idle_add in a single line, works as you’d expect.

        Previous commenters probably didn’t look at Python in a really long time.

        • Jumuta@sh.itjust.works
          link
          fedilink
          arrow-up
          1
          ·
          15 days ago

          i mean tbf match case was only added in 3.10

      • vrighter@discuss.tchncs.de
        link
        fedilink
        arrow-up
        6
        arrow-down
        1
        ·
        15 days ago

        a lambdo which can only contain one expression, and not even a statement is pretty much useless. For anything nontrivial you have to write a separate function and have the lambda be just a function call expression. Which completely defeats the point

    Programmer Humor@lemmy.ml

    programmerhumor@lemmy.ml

    Subscribe from Remote Instance

    Create a post
    You are not logged in. However you can subscribe from another Fediverse account, for example Lemmy or Mastodon. To do this, paste the following into the search field of your instance: !programmerhumor@lemmy.ml

    Post funny things about programming here! (Or just rant about your favourite programming language.)

    Rules:

    • Posts must be relevant to programming, programmers, or computer science.
    • No NSFW content.
    • Jokes must be in good taste. No hate speech, bigotry, etc.
    Visibility: Public
    globe

    This community can be federated to other instances and be posted/commented in by their users.

    • 18 users / day
    • 1.23K users / week
    • 3.58K users / month
    • 7.59K users / 6 months
    • 1 local subscriber
    • 36.7K subscribers
    • 688 Posts
    • 2.9K Comments
    • Modlog
    • mods:
    • cat_programmer@lemmy.ml
    • UI: unknown version
    • BE: 0.19.8
    • Modlog
    • Instances
    • Docs
    • Code
    • join-lemmy.org