Does this make Python usable like TS does for JS? >inb4 don't use python

Does this make Python usable like TS does for JS?
>inb4 don't use python
I'm afraid the project I help maintain is too big for that

UFOs Are A Psyop Shirt $21.68

DMT Has Friends For Me Shirt $21.68

UFOs Are A Psyop Shirt $21.68

  1. 1 month ago
    Anonymous

    the project you maintain will never be ported to python 3.13 which both has a jIT and removes GIL, just give up and rewrite it in Go or something

    • 1 month ago
      Anonymous

      Removes GIL, what? How is tht possible? People have tried for years.

      • 1 month ago
        Anonymous

        Microsoft money and Guido on top of it

  2. 1 month ago
    Anonymous

    >mypy
    what you want is https://github.com/microsoft/pyright

  3. 1 month ago
    Anonymous

    do it in another language please.
    I almost lost my sanity maintaining my own 1000 lines of python, and I can't imagine how bad it could be for a larger codebase.

    • 1 month ago
      Anonymous

      I've got a codebase of hundreds of Python files where single files may have a thousand lines of intensely Pythonic code.
      I didn't make this pile of shit, but I get to clean it up. Rewriting in another language isn't practical either.

    • 1 month ago
      Anonymous

      This

      I've got a codebase of hundreds of Python files where single files may have a thousand lines of intensely Pythonic code.
      I didn't make this pile of shit, but I get to clean it up. Rewriting in another language isn't practical either.

      Use Haskell. Proper type system with pleasant concurrency abstractions. Makes life easier.

    • 1 month ago
      Anonymous

      Lazy homosexual. You're writing trash then it's somehow the language problem

      • 1 month ago
        Anonymous

        I have had projects that are 10 times larger in other languages and I never had a problem

    • 1 month ago
      Anonymous

      if you have trouble maintaining 1000 lines of code YOU WROTE, then your code is shit, you dont really know what youre doing or both.

  4. 1 month ago
    Anonymous

    optional static types never work, because of the "optional" part.
    Elixir is on its third try with optional typing currently.

    • 1 month ago
      Anonymous

      they work better than non-optional typing because you can prototype shit much faster and add types where they actually help.
      PHP is a good example of this

      • 1 month ago
        Anonymous

        The "faster prototyping" thing is such a terrible argument because
        1. it leaves out the time spent dealing with run-time (type) errors during prototyping
        2. Exaggerates the burden of typing and all the run time errors it would have prevented
        3. You're writing the program twice
        Python just needs to copy Ocaml and lean into inference with mandatory types.

        • 1 month ago
          Anonymous

          Types are mandatory.
          Fricking sick of having to guess the methods of shit because they go through a 20 step build pipeline.

    • 1 month ago
      Anonymous

      No, use C# instead

      Interpreted garbage you haven’t tried using to know it is one

  5. 1 month ago
    Anonymous

    Yes.

  6. 1 month ago
    Anonymous

    I thought the point of typescript was to make js strongly typed (ie get rid of implicit type conversion)
    python doesnt have this problem to begin with
    if youre sloppy with variable names and somehow manage to reassign a variable to a different type by accident, thats a you problem and something that should never happen

    • 1 month ago
      Anonymous

      >if youre sloppy with variable names and somehow manage to reassign a variable to a different type by accident, thats a you problem and something that should never happen
      While its indeed a "you problem" its still useful to have a linter tell you about it before you actually run the code. Obviously something like this can be caught by your tests (you DO write tests, right?).

  7. 1 month ago
    Anonymous

    pyright is better but it's javascript cancer

  8. 1 month ago
    Anonymous

    If you run it with the --strict flag. You should also set ci/cd to enforce it on all PR's. Ignore the NEETs.

  9. 1 month ago
    Anonymous

    Python ia good as it is.

    NYET. SNAKE IS GOOD

  10. 1 month ago
    Anonymous

    >JS
    Python is usable without static checker bolted on to of it, unlike JS. Problem with JS is not that it is dynamically typed, but that it is shit.
    `undefined`? `===` everywhere? `+` and `-` coerce (differently), instead of throwing error (even PHP does it better, by acting weak-typed and having '+' as addition and '.' as concat)? Variable assignment shitting into default object? `obj.f(x)` and `(obj.f)(x)` doing different things? (again, if you do not want to implement first-class bound methods, have different syntax for bind-and-execute, like Lua does with 'o:f(x)`)
    >mypy
    Useful, but:
    1) you still need proper test coverage
    2) attempt to have everything annotated will quickly turn your code into bloated static-typing-as-seen-by-static-typing-hater mess and double your work
    In my experience, Mypy (and Erlang's dialyzer, which is basically same idea) is mostly useful to check annotations (which are in turn useful as documentation) being consistent.

  11. 1 month ago
    Anonymous

    1. Find smallest service with clear APIs
    2. Rewrite in Go
    3. Shadow traffic (input only) to mirror service, compare outputs
    4. Monitor services for a few weeks and switch over to new one if identical
    5. turn off old service
    6. Repeat
    https://blog.khanacademy.org/half-a-million-lines-of-go/

    Then again, it's probably not up to you to decide something like this.
    Best you can do is make sure that your CI/CD blocks all merge requests without all the checkers and enforcers that you can throw at it or hope that Mojo takes off fast enough

  12. 1 month ago
    Anonymous

    There is no bigger tell for a midwit brain than the obsession with forcing static typing everywhere.

  13. 1 month ago
    Anonymous

    Python's problem is not missing types. It's slow as frick.

  14. 1 month ago
    Anonymous

    mypy is a buggy piece of shit.
    pyright is too but at least they fix the bugs fast thanks to paid microsoft devs.

Your email address will not be published. Required fields are marked *