home.social

#pyright — Public Fediverse posts

Live and recent posts from across the Fediverse tagged #pyright, aggregated by home.social.

  1. #CodeQuality of the lazy developer 🛠️

    Updating an educational #Python repo, I looked into what to automate for code quality.

    🔮 Spoiler: I landed on uv, ruff, pyright and pre-commit.

    In the article: the picks, why, and the make patch that broke on the first try 😄

    alessandra.bilardi.net/diary/a

    #DiaryOfALazyDeveloper #pytest #ruff #pyright #uv

  2. #CodeQuality of the lazy developer 🛠️

    Updating an educational #Python repo, I looked into what to automate for code quality.

    🔮 Spoiler: I landed on uv, ruff, pyright and pre-commit.

    In the article: the picks, why, and the make patch that broke on the first try 😄

    alessandra.bilardi.net/diary/a

    #DiaryOfALazyDeveloper #pytest #ruff #pyright #uv

  3. With high-performance #Python type checkers like #Pyright, #Pyrefly, and #ty now available, what's the value proposition of #Mypy? Is it the reference implementation? Or does Mypy still have the most features? I'm not trying to knock Mypy, I'm genuinely asking because I don't know.

  4. With high-performance #Python type checkers like #Pyright, #Pyrefly, and #ty now available, what's the value proposition of #Mypy? Is it the reference implementation? Or does Mypy still have the most features? I'm not trying to knock Mypy, I'm genuinely asking because I don't know.

  5. With high-performance #Python type checkers like #Pyright, #Pyrefly, and #ty now available, what's the value proposition of #Mypy? Is it the reference implementation? Or does Mypy still have the most features? I'm not trying to knock Mypy, I'm genuinely asking because I don't know.

  6. With high-performance #Python type checkers like #Pyright, #Pyrefly, and #ty now available, what's the value proposition of #Mypy? Is it the reference implementation? Or does Mypy still have the most features? I'm not trying to knock Mypy, I'm genuinely asking because I don't know.

  7. With high-performance #Python type checkers like #Pyright, #Pyrefly, and #ty now available, what's the value proposition of #Mypy? Is it the reference implementation? Or does Mypy still have the most features? I'm not trying to knock Mypy, I'm genuinely asking because I don't know.

  8. 🚀🎉 Hold onto your keyboards, folks! #Astral has unleashed "ty," a lightning-fast #Python #type #checker, because, of course, we needed another one. Written in #Rust, because Python apparently wasn't fast enough for checking itself, "ty" is now in #Beta and ready to bravely enter a market already saturated with the likes of #mypy, #Pyright, and other tools you didn't know you couldn't live without. 🌪️🔧
    astral.sh/blog/ty #ty #HackerNews #ngated

  9. 🚀🎉 Hold onto your keyboards, folks! #Astral has unleashed "ty," a lightning-fast #Python #type #checker, because, of course, we needed another one. Written in #Rust, because Python apparently wasn't fast enough for checking itself, "ty" is now in #Beta and ready to bravely enter a market already saturated with the likes of #mypy, #Pyright, and other tools you didn't know you couldn't live without. 🌪️🔧
    astral.sh/blog/ty #ty #HackerNews #ngated

  10. 🚀🎉 Hold onto your keyboards, folks! #Astral has unleashed "ty," a lightning-fast #Python #type #checker, because, of course, we needed another one. Written in #Rust, because Python apparently wasn't fast enough for checking itself, "ty" is now in #Beta and ready to bravely enter a market already saturated with the likes of #mypy, #Pyright, and other tools you didn't know you couldn't live without. 🌪️🔧
    astral.sh/blog/ty #ty #HackerNews #ngated

  11. 🚀🎉 Hold onto your keyboards, folks! #Astral has unleashed "ty," a lightning-fast #Python #type #checker, because, of course, we needed another one. Written in #Rust, because Python apparently wasn't fast enough for checking itself, "ty" is now in #Beta and ready to bravely enter a market already saturated with the likes of #mypy, #Pyright, and other tools you didn't know you couldn't live without. 🌪️🔧
    astral.sh/blog/ty #ty #HackerNews #ngated

  12. All fun and games in #python land until black decides to reformat your #pyright type ignore pragmas 🙄

  13. TIL the overload() decorator for Python, for describing methods that support multiple different combinations of argument types. A great way to make your typechecker happy: it's much stricter and clearer than just combining multiple types with "|".

    docs.python.org/3/library/typi

  14. @seungjin ... #pyright bas the problems of JS : slow....

    Python devs are waiting for #ty a rust type checker, built by astral, the ones who did #ruff and #UV

  15. @seungjin I write #python code every day, and type hints are a "syntactic sugar" and are not required at all from the interpreter point of view.

    For large projects, it's useful to add hints to "follow" what you are doing, and type checkers like #pyright or #mypy can help to find some bugs, by example when calling a method with wrong parameters types.

    It also help for the readability of the code.

  16. Our of the box, is "better" than . Less configuration and more strict!

  17. Survey on use of types in Python among around 1000 developers. 88% of respondents “Always” or “Often” use Types in their Python code.

    Study conducted by Meta, JetBrains, and Microsoft, results on a Google dashboard.

    engineering.fb.com/2024/12/09/

    #python #mypy #pycharm #pyright

  18. Does this #pyright error strike any other #Python peeps as wrong?

    “Return type mismatch: base method returns type "Literal['']", override returns type "str""

    It's giving me a type error when I override a method that returned a literal string with a string I construct. That doesn't make any sense.

  19. To all users currently using as their language server: switch to basedpyright. If only for import completion.

  20. Dear #python :python: Community,

    I use #neovim, what’s the ideal setup for #lsp to include type checking these days? #ruff #pyright

  21. Вийшла нова версія #pyright

    > Added experimental support for multithreaded type checking in CLI. You can now specify `--threads` followed by an optional thread count. 

    ```
    > time pnpm dlx pyright@latest --level error
    49.19s user 1.73s system 135% cpu 37.592 total

    > time pnpm dlx pyright@latest --level error --threads
    314.00s user 12.80s system 1380% cpu 23.672 total
    ```

    #python

  22. If `pyright --verifytypes yourapp` cannot find `py.typed` marker for your package, you probably need to set PYTHONPATH="." (or "src", to a pathc where your module is located).

    #python #pyright

  23. I just wanted to try #pyright to type-check my #python code, but alas NO.

    Not only does it seem to require Node for some insane reason, it requires SSL certificates to even run at all?!

    You literally can't run `pyright --version` without it trying to create some sort of SSL object.

    Like.. WTF?! What are we even doing here?

  24. A guide on integrating #emacs + #python + #hatch using [mostly] builtin tooling and project local .dir-locals.el variables.

    Specifically, this setup uses #Eglot + #pyright for live syntax checking, #pytest for code running, #MyPy for type-checking, and #IPython as the shell

    Feedback would be welcome -- trying to get it robust + idiomatic.

    jtmoulia.srht.site/guides/emac

  25. @mykhaylo any good candidate article from the top of your head? my biggest success for now — #eglot uses python-ts-mode and #pyright, but only with system python, ignoring what I set pyrightconfig.json or when running emacs inside activated venv.

  26. #python #pyright

    Сьогодні перший раз за всю історію мого користування Pyright, коли на проекті не треба було ніяких змін після апдейту Pyright.

    > 0 errors, 745 warnings, 793 informations

  27. I've made a Python :python: code linting Action ▶️ for GitHub :github: Code Scanning.

    It wraps up , , , , , and into an Action that uploads to Code Scanning, part of Advanced Security, the GitHub appsec platform.

    ℹ️ that’s free for open source repos hosted on GitHub!

    Read 📖 about it👇 on my blog:
    lnkd.in/es_pd2W6

    Try ⚙️ it👇 on the Actions ▶️ marketplace:
    lnkd.in/ei7-H2V9

  28. I've made a Python :python: code linting Action ▶️ for GitHub :github: Code Scanning.

    It wraps up #Ruff, #Flake8, #Pylint, #Fixit2, #Mypy, #Pyright and #Pytype into an Action that uploads to Code Scanning, part of Advanced Security, the GitHub appsec platform.

    ℹ️ that’s free for open source repos hosted on GitHub!

    Read 📖 about it👇 on my blog:
    lnkd.in/es_pd2W6

    Try ⚙️ it👇 on the Actions ▶️ marketplace:
    lnkd.in/ei7-H2V9

    #Python #Linting #CodeQuality #Linters #SARIF #GitHubActions

  29. I've made a Python :python: code linting Action ▶️ for GitHub :github: Code Scanning.

    It wraps up #Ruff, #Flake8, #Pylint, #Fixit2, #Mypy, #Pyright and #Pytype into an Action that uploads to Code Scanning, part of Advanced Security, the GitHub appsec platform.

    ℹ️ that’s free for open source repos hosted on GitHub!

    Read 📖 about it👇 on my blog:
    lnkd.in/es_pd2W6

    Try ⚙️ it👇 on the Actions ▶️ marketplace:
    lnkd.in/ei7-H2V9

    #Python #Linting #CodeQuality #Linters #SARIF #GitHubActions

  30. I've made a Python :python: code linting Action ▶️ for GitHub :github: Code Scanning.

    It wraps up #Ruff, #Flake8, #Pylint, #Fixit2, #Mypy, #Pyright and #Pytype into an Action that uploads to Code Scanning, part of Advanced Security, the GitHub appsec platform.

    ℹ️ that’s free for open source repos hosted on GitHub!

    Read 📖 about it👇 on my blog:
    lnkd.in/es_pd2W6

    Try ⚙️ it👇 on the Actions ▶️ marketplace:
    lnkd.in/ei7-H2V9

    #Python #Linting #CodeQuality #Linters #SARIF #GitHubActions

  31. I've made a Python :python: code linting Action ▶️ for GitHub :github: Code Scanning.

    It wraps up #Ruff, #Flake8, #Pylint, #Fixit2, #Mypy, #Pyright and #Pytype into an Action that uploads to Code Scanning, part of Advanced Security, the GitHub appsec platform.

    ℹ️ that’s free for open source repos hosted on GitHub!

    Read 📖 about it👇 on my blog:
    lnkd.in/es_pd2W6

    Try ⚙️ it👇 on the Actions ▶️ marketplace:
    lnkd.in/ei7-H2V9

    #Python #Linting #CodeQuality #Linters #SARIF #GitHubActions

  32. Third time seems to be the charm. After 2 attempts with spacemacs, I finally seem to have gotten a working setup with #Doomemacs.

    The thing that took the longest time to figure out was getting
    #pyenv and #pyright to work correctly.

    1. pyenv - project integration code needed to be added
    2. pyenvs should be then created in the same name as the project itself
    3. pyenv local needed to be run to create .python-version file
    4. both lsp and tree-sitter tools enabled and added to python

    Now I am almost feature parity with my
    #lunarvim #neotest setup to run tests. The final piece missing is DAP debugger... coming at you DAP

  33. Even though it’s been many years of using , I feel like I always need a refresher with stuff.

    Let’s say you have installed, it’s in Mason and in your PATH, and code snippets/cmp are showing up as expected.

    Why would a definition like “Path” (from pathlib import Path) show up, but not something even more simple like “split” or “print”?

    🧐🤔

  34. Ran into a weird situation where #pyright would flag mundane #Python code as having typing errors. After much head scratching, figured out it only happens if you have a py.typed file in site-packages (and typing_extensions installed).

    It turns out that #autoflake was installing such a py.typed file. That's fixed by v2.2.1, a quick release by @fsouza.

    So if you ever get unexpected pyright errors for code that was OK before, look for a py.typed file in site-packages.

    github.com/PyCQA/autoflake/iss

  35. @ambv so, what do you think about this problem?

    It also behaves the same way in mypy. But here bug is not closed, and i'm hoping it can be fixed.

    github.com/python/mypy/issues/

    #Python #PythonTyping #Mypy #Pyright

  36. #Python #PythonTyping #Pyright #Pylance #Mypy

    Is there a way to create type stub only for part of the library?

    For example: I want to include types for a single object, but don't want to maintain full copy of the library types.

    github.com/carltongibson/djang

  37. Anybody found a way to make the #Pylance type checker understand Click decorators?

    #Mypy understands them just fine.

    #Python #PyRight