Re:SQLModel – SQL Databases in FastAPI
by tiangolo on Wednesday August 25, 2021 @07:01AM
(#28300039)
Yep, but not secret, it's the in-progress dataclass_transform draft spec, already implemented in (open source) Pyright, and Pylance re-uses Pyright, so it gets that support.
https://github.com/microsoft/pyright/blob/main/specs/datacla...
Re:SQLModel – SQL Databases in FastAPI
by Xavdidtheshadow on Wednesday August 25, 2021 @11:37PM
(#28310360)
There you go! Not secret at all. Thanks for linking that!
Anecdata, but when I was digging into how Dataclasses worked, Pylance had great completion, but only if I imported from the dataclass module itself. If I pasted the whole implementation into a local file and used that, I didn't get the hints.
This makes me think that Pylance _does_ have some secret sauce.