Gifted Minecraft
  • Communities
  • Create Post
  • Create Community
  • heart
    Support Lemmy
  • search
    Search
  • Login
  • Sign Up
Maven (famous)@lemmy.zip to Programmer Humor@programming.dev · 2 days ago

Modern Programming

lemmy.zip

message-square
74
fedilink
566

Modern Programming

lemmy.zip

Maven (famous)@lemmy.zip to Programmer Humor@programming.dev · 2 days ago
message-square
74
fedilink
  • Randelung@lemmy.world
    link
    fedilink
    arrow-up
    10
    ·
    edit-2
    2 days ago

    Python does that, too.

    https://docs.python.org/3/library/stdtypes.html#boolean-operations-and-or-not

    • SatyrSack@lemmy.sdf.org
      link
      fedilink
      arrow-up
      2
      arrow-down
      1
      ·
      2 days ago

      Are you just referring to how Python uses the English and/or instead of the more common &&/||? I think what the user above you was talking about was Lua’s strange ternary syntax using and/or.

      • lime!@feddit.nu
        link
        fedilink
        English
        arrow-up
        6
        ·
        edit-2
        1 day ago

        no, the linked table shows how python also returns the first non-falsey result of an a or b expression rather than just giving a boolean. it’s useful for initialising optional reference args:

        def foo(a: list = None)
            a = a or []
        

        works with and as well.

Programmer Humor@programming.dev

programmer_humor@programming.dev

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: !programmer_humor@programming.dev

Welcome to Programmer Humor!

This is a place where you can post jokes, memes, humor, etc. related to programming!

For sharing awful code theres also Programming Horror.

Rules

  • Keep content in english
  • No advertisements
  • Posts must be related to programming or programmer topics
Visibility: Public
globe

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

  • 2.87K users / day
  • 5.32K users / week
  • 10.3K users / month
  • 19.4K users / 6 months
  • 1 local subscriber
  • 24.1K subscribers
  • 1.42K Posts
  • 47.3K Comments
  • Modlog
  • mods:
  • Feyter@programming.dev
  • adr1an@programming.dev
  • BurningTurtle@programming.dev
  • Pierre-Yves Lapersonne@programming.dev
  • BE: 0.19.9
  • Modlog
  • Legal
  • Instances
  • Docs
  • Code
  • join-lemmy.org