GNU social JP
  • FAQ
  • Login
GNU social JPは日本のGNU socialサーバーです。
Usage/ToS/admin/test/Pleroma FE
  • Public

    • Public
    • Network
    • Groups
    • Featured
    • Popular
    • People

Conversation

Notices

  1. Embed this notice
    ari :prideified: (ar@is-a.cat)'s status on Wednesday, 07-Aug-2024 20:56:08 JST ari :prideified: ari :prideified:

    both this

    def argv_transform(argv):
    for arg in argv:
    k, v = arg.split("=")
    yield k, v.split(",")

    and this:

    def argv_transform(argv):
    for arg in argv:
    k, v = arg.split("=")
    yield k, v.split(",")

    is valid (doesn't throw obvious errors) python code.
    tbqh, I would've expected k, v to be out of scope in the second example, and the function to throw an error.

    In conversation about 10 months ago from is-a.cat permalink
    • Embed this notice
      nina (q66@blahaj.social)'s status on Wednesday, 07-Aug-2024 20:56:05 JST nina nina
      in reply to

      @ar i mean i can see where they wanted to go with it (doing it the way it is means... no need for a keyword for variables, no need to worry about block scoping, no need to worry about shadowing, simplified initialization semantics, etc.)

      but it still sucks sometimes

      In conversation about 10 months ago permalink
      Haelwenn /элвэн/ :triskell: likes this.
    • Embed this notice
      ari :prideified: (ar@is-a.cat)'s status on Wednesday, 07-Aug-2024 20:56:07 JST ari :prideified: ari :prideified:
      in reply to
      • nina

      @q66 yup, and this one was especially annoying as it was an artifact of moving code around (-> changing indentation) *and* still returned seemingly valid data

      In conversation about 10 months ago permalink
    • Embed this notice
      nina (q66@blahaj.social)'s status on Wednesday, 07-Aug-2024 20:56:08 JST nina nina
      in reply to

      @ar well the single crappiest thing about python that i dislike the most is that it does not actually have the concept of scope (beyond functions)

      having scope would also need some other things (such as variable declarations, which would also eliminate gross hacks like `nonlocal`)

      in the end i guess it's a tradeoff with the intent of reducing syntax noise, but it can lead to legit bugs

      In conversation about 10 months ago permalink

Feeds

  • Activity Streams
  • RSS 2.0
  • Atom
  • Help
  • About
  • FAQ
  • TOS
  • Privacy
  • Source
  • Version
  • Contact

GNU social JP is a social network, courtesy of GNU social JP管理人. It runs on GNU social, version 2.0.2-dev, available under the GNU Affero General Public License.

Creative Commons Attribution 3.0 All GNU social JP content and data are available under the Creative Commons Attribution 3.0 license.