5 ms·
> maybe pylance is special casing something? Anecdata, but when I was digging into how Dataclasses worked, Pylance had great completion, but only if I imported
by Xavdidtheshadow 5y ago
> maybe pylance is special casing something?
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.
- tiangolo 5y agoYep, 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/dataclass_transforms.md https://github.com/microsoft/pyright/blob/main/specs/datacla...
- Xavdidtheshadow 5y agoThere you go! Not secret at all. Thanks for linking that!