Our great sponsors
-
SurveyJS
Open-Source JSON Form Builder to Create Dynamic Forms Right in Your App. With SurveyJS form UI libraries, you can build and style forms in a fully-integrated drag & drop form builder, render them in your JS app, and store form submission data in any backend, inc. PHP, ASP.NET Core, and Node.js.
-
coc.nvim
Nodejs extension host for vim & neovim, load extensions like VSCode and host language servers.
-
InfluxDB
Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.
I just published a fresh release of pyee and boy does it have a lot of changes from the last *counts on fingers* 5 months! I wanted to talk about the changes and what went into them, as some of them are fun and interesting.
The most important change in v9 is type annotations, type-checked with pyright and tagged with a py.typed file so it (hopefully) works in mypy - if your type checker complains to you about missing stubs, please file an issue!! I really want this to work!
I mentioned that pyright is written in typescript, but what's really funny is that pyright is basically tsc's type checker but for Python. The type checking output between tsc and pyright are so similar that I sometimes get confused about which language I'm working with. This, I suppose, explains the Node.js dependency. But I work with typescript quite a bit now - it's a standard part of Eaze's stack, sure, but it's also a language I earnestly enjoy. It feels like a structurally typed scala! It has a rough analog to scalaz! Its type system is way more powerful than it has any business being?? What's not to love? So given that typescript is already a standard part of my stack, this synergy is - as it turns out - really valuable. It's great!
As a bonus, pyright's baked in vscode support - something it shares with typescript - not only implies a buttery smooth vs code environment, but also leaves the door open for other lsp-friendly editor/IDE plugins. I personally use neovim and coc.nvim, and as it turns out pyright integrates with coc.nvim quite nicely.
As a bonus, pyright's baked in vscode support - something it shares with typescript - not only implies a buttery smooth vs code environment, but also leaves the door open for other lsp-friendly editor/IDE plugins. I personally use neovim and coc.nvim, and as it turns out pyright integrates with coc.nvim quite nicely.
As a bonus, pyright's baked in vscode support - something it shares with typescript - not only implies a buttery smooth vs code environment, but also leaves the door open for other lsp-friendly editor/IDE plugins. I personally use neovim and coc.nvim, and as it turns out pyright integrates with coc.nvim quite nicely.
We can start by looking at what the DefinitelyTyped stubs for node core, and there we see that the event name really is typed string (or Symbol, but Python doesn't have those), and that handlers are typed (...args: any[]) => void. This type annotation is slightly better than Callable - the closest thing in Python is a bit like this:
Related posts
- There's another typescript LSP that wraps the official VSCode typescript extension and has almost the same features - vtsls
- Introducing tsc.nvim: Project-Wide Asynchronous TypeScript Type-Checking & Diagnostics
- Easymotion with VSCode-Neovim
- Instantiating a treesitter parser object crashes my typescript rplugin
- A pragmatic approach to migrating from VSCode to Neovim