• Rooki@lemmy.world
      link
      fedilink
      arrow-up
      9
      arrow-down
      3
      ·
      1 year ago

      You forgot your indentation and a third party docs is outdated. Now try and debug it with this error message:

      Not enough value to unpack (expected 2, got 1) (not any stack trace btw) documentation was terrible. :D

      • herr@lemmy.world
        link
        fedilink
        arrow-up
        10
        arrow-down
        3
        ·
        edit-2
        1 year ago

        Huh? The Python Stacktrace is great. What kinda fucked up library were you using that it prints the error code instead of raising an exception?!

        Also don’t think outdated library docs are a fault of Python 😅 In much the opposite way, I’ve found Python’s standard library to be really great, reducing the number of random third party libraries needed. (Looking at you, JavaScript)

        • Rooki@lemmy.world
          link
          fedilink
          arrow-up
          1
          arrow-down
          2
          ·
          1 year ago

          Stack trace is terrible bad. Js for the win.

          the default library is still terribly documented. OF COURSE everything is stated there but after reading the bible 3 times through you still didnt understand anything third or first party libraries!.

          In python you need weirdly random packages that are inbuild but you still have to import them WHY THO??? ( looking at you typings )

          The funniest thing is that python does not have a switch case where i heard it the first time, i laughed and didnt took him serious but then after looking into it, A BASIC SWITCH CASE does not exist in python. LMAO

          • herr@lemmy.world
            link
            fedilink
            arrow-up
            3
            ·
            edit-2
            1 year ago

            Imagine getting hung up on something as trivial as a switch statement. Which is more poignant, I ask you?

            switch(var){
               case 1: 
                  <code>;
                  break;
               case 2: 
                  <code>;
                  break;
               case 3: 
                  <code>;
                  break;
               default:
                  <code>
            }
            

            or

            if var == 1:
               <code>
            elif var == 2:
               <code>
            elif var== 3:
               <code>
            else:
                <code>
            

            The performance difference is absolutely negligible, but now you’ve introduced a bunch of unnecessary indentation (for no benefit) that’s gonna get hard to read should you even add a little bit of additional logic, and a footgun with all the break; s.

            And then in JS the syntax for the case-blocks isn’t even consistent with the rest of the language.</code></code></code></code></code></code></code></code>

          • malijaffri@feddit.ch
            link
            fedilink
            arrow-up
            1
            arrow-down
            1
            ·
            edit-2
            1 year ago

            I’m sorry, but when was the last time you actually used Python? Python has had a switch ... case ...-like structure called match ... case ... since v3.10:

            https://www.geeksforgeeks.org/python-match-case-statement/

            As for having to import standard libraries, why should every single function of every single built-in library be included in every single Python program, much less in compiled executables? At that point, it just bloats up your file sizes and RAM usage.

            ETA: You are literally the only person in this whole thread that has such a huge problem with Python. What did it ever do to you?

      • Mikurei@lemmy.ml
        link
        fedilink
        arrow-up
        3
        ·
        edit-2
        1 year ago

        You forgot your indentation

        Sounds like a problem for someone who is writing the code on a toilet paper or whiteboard. Most people have some sort of hackable editor/IDE that handles the indentation and code blocks.

        obfuscated error messages

        Just don’t use libraries which print or log exceptions without raising it :)