• wewbull@feddit.uk
    link
    fedilink
    English
    arrow-up
    3
    arrow-down
    2
    ·
    18 days ago

    As I would expect. Does the result surprise people?

    If so, rename the arguments to fun() to be r, s, t, and u. Just inside the function. Does the obvious two scopes now make it clearer?

      • lad@programming.dev
        link
        fedilink
        English
        arrow-up
        2
        ·
        17 days ago

        To be fair, I had to read the linked question on SO to understand what was the possible alternative. I do expect that if I use += it is in place.

        On the other hand with Python and Java I always keep forgetting if everything is by value or by reference, I really miss some extra clarity of the languages where you can see if something is mutable when passed to a function

    • 5C5C5C@programming.dev
      link
      fedilink
      arrow-up
      5
      arrow-down
      1
      ·
      18 days ago

      Looks like this whole post is an ad for someone’s project. The links hardly have to do with the post.

      • bterwijn@programming.devOP
        link
        fedilink
        arrow-up
        3
        ·
        edit-2
        17 days ago

        The “Solution” link gives the solution to the exercise, the “Explanation” link explains the Python data model concepts behind the exercise. If some parts are hard to understand let me know.

      • logging_strict@programming.dev
        link
        fedilink
        arrow-up
        1
        arrow-down
        1
        ·
        17 days ago

        Yeah and the link went to a site with in-browser remote code execution. Dodgy.

        Clicking Play or GetURL did nothing.

        Luckily my browser is as old as me. And was too grumpy to actually do what it’s told.