#pyright — Public Fediverse posts
Live and recent posts from across the Fediverse tagged #pyright, aggregated by home.social.
-
#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 😄
https://alessandra.bilardi.net/diary/articles/2026-04/the-lazy-developer-s-code-quality.en
-
#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 😄
https://alessandra.bilardi.net/diary/articles/2026-04/the-lazy-developer-s-code-quality.en
-
🚀🎉 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. 🌪️🔧
https://astral.sh/blog/ty #ty #HackerNews #ngated -
🚀🎉 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. 🌪️🔧
https://astral.sh/blog/ty #ty #HackerNews #ngated -
🚀🎉 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. 🌪️🔧
https://astral.sh/blog/ty #ty #HackerNews #ngated -
🚀🎉 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. 🌪️🔧
https://astral.sh/blog/ty #ty #HackerNews #ngated -
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 "|".
https://docs.python.org/3/library/typing.html#typing.overload
-
@feoh Yup. For me its way better than #pyright or #basedpyright.
-
@feoh Yup. For me its way better than #pyright or #basedpyright.
-
@feoh Yup. For me its way better than #pyright or #basedpyright.
-
@feoh Yup. For me its way better than #pyright or #basedpyright.
-
@feoh Yup. For me its way better than #pyright or #basedpyright.
-
@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.
-
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.
https://engineering.fb.com/2024/12/09/developer-tools/typed-python-2024-survey-meta/
-
Let's see if an issue gets traction: https://github.com/microsoft/pyright/issues/9648
-
https://github.com/sbdchd/django-types/blob/main/README.md contains a lot of interesting things which one should do for proper #type #checking on #django projects. #pyright #basedpyright #python
-
https://github.com/sbdchd/django-types/blob/main/README.md contains a lot of interesting things which one should do for proper #type #checking on #django projects. #pyright #basedpyright #python
-
https://github.com/sbdchd/django-types/blob/main/README.md contains a lot of interesting things which one should do for proper #type #checking on #django projects. #pyright #basedpyright #python
-
https://github.com/sbdchd/django-types/blob/main/README.md contains a lot of interesting things which one should do for proper #type #checking on #django projects. #pyright #basedpyright #python
-
https://github.com/sbdchd/django-types/blob/main/README.md contains a lot of interesting things which one should do for proper #type #checking on #django projects. #pyright #basedpyright #python
-
Вийшла нова версія #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
``` -
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?
-
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.
-
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:
https://lnkd.in/es_pd2W6Try ⚙️ it👇 on the Actions ▶️ marketplace:
https://lnkd.in/ei7-H2V9#Python #Linting #CodeQuality #Linters #SARIF #GitHubActions
-
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:
https://lnkd.in/es_pd2W6Try ⚙️ it👇 on the Actions ▶️ marketplace:
https://lnkd.in/ei7-H2V9#Python #Linting #CodeQuality #Linters #SARIF #GitHubActions
-
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:
https://lnkd.in/es_pd2W6Try ⚙️ it👇 on the Actions ▶️ marketplace:
https://lnkd.in/ei7-H2V9#Python #Linting #CodeQuality #Linters #SARIF #GitHubActions
-
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:
https://lnkd.in/es_pd2W6Try ⚙️ it👇 on the Actions ▶️ marketplace:
https://lnkd.in/ei7-H2V9#Python #Linting #CodeQuality #Linters #SARIF #GitHubActions
-
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:
https://lnkd.in/es_pd2W6Try ⚙️ it👇 on the Actions ▶️ marketplace:
https://lnkd.in/ei7-H2V9#Python #Linting #CodeQuality #Linters #SARIF #GitHubActions
-
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 -
Even though it’s been many years of using #neovim, I feel like I always need a refresher with #lsp stuff.
Let’s say you have #pyright 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”?
🧐🤔
-
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.
-
@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.
-
#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.
https://github.com/carltongibson/django-filter/pull/1585/files