Skip to contentSkip to conversation

tuna: Add Pyright helper

PATCH In review John B. Wyatt IV 2 participants 2 messages Jul 22, 2025 – Jul 25, 2025

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 tuna: Add Pyright helper

Pyright is a common tool to assist with linting and finding errors in Python programs with an LSP like Visual Studio Code, Neovim, and Emacs. _("") syntax convention is used by gettext for translations and is a common default but Pyright needs to be set to not give an error for it. Add __builtins__.pyi with the _() convention to satisfy Pyright.

---
 __builtins__.pyi | 1 +
 1 file changed, 1 insertion(+)
 create mode 100644 __builtins__.pyi
__builtins__.pyi new file +1 -0
new file mode 100644
index 0000000..0e3a4b2
@@ -0,0 +1 @@
+def _(s: str) -> str: ...
Signature · 1 line
2.50.1
#1 lore raw
Quoted 4 lines · John B. Wyatt IV

Pyright is a common tool to assist with linting and finding errors in Python programs with an LSP like Visual Studio Code, Neovim, and Emacs. _("") syntax convention is used by gettext for translations and is a common default but Pyright needs to be set to not give an error for it. Add

__builtins__.pyi

Quoted 21 lines

with the _() convention to satisfy Pyright.

---
 __builtins__.pyi | 1 +
 1 file changed, 1 insertion(+)
 create mode 100644 __builtins__.pyi
__builtins__.pyi new file +1 -0
new file mode 100644
index 0000000..0e3a4b2
@@ -0,0 +1 @@
+def _(s: str) -> str: ...
Signature · 1 line
2.50.1