awful.systems
  • Communities
  • Create Post
  • heart
    Support Lemmy
  • search
    Search
  • Login
  • Sign Up
@bestelbus22@lemmy.world to Programmer Humor@lemmy.mlEnglish • 5 days ago

The meaning of this

lemmy.ml

message-square
56
fedilink
520

The meaning of this

lemmy.ml

@bestelbus22@lemmy.world to Programmer Humor@lemmy.mlEnglish • 5 days ago
message-square
56
fedilink
  • Sjmarf
    link
    fedilink
    English
    17•5 days ago

    Python does have a switch statement now, actually. And yes, they went out of their way to call it something different - match.

    https://docs.python.org/3/tutorial/controlflow.html#match-statements

    • @NichtElias@sh.itjust.works
      link
      fedilink
      11•5 days ago

      match isn’t just equivalent to switch though, so in this case it actually makes sense to call it something different.

      • @Archr@lemmy.world
        link
        fedilink
        1•2 days ago

        This is very true. Match statements are much more powerful that switch statements in any other language.

        For instance:

        • matching objects very specifically
        • if conditions within case statements
        • pulling variables from inside of the object directly.

Programmer Humor@lemmy.ml

!programmerhumor@lemmy.ml

remote_follow_modal_title

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.
  • 312 users / day
  • 1.66K users / week
  • 3.51K users / month
  • 9.62K users / 6 months
  • 36.4K subscribers
  • 1.68K Posts
  • 30.9K Comments
  • Modlog
  • mods:
  • @AgreeableLandscape@lemmy.ml
  • @cat_programmer@lemmy.ml
  • BE: 0.19.3
  • Modlog
  • Instances
  • Docs
  • Code
  • join-lemmy.org