Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> 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.



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...


There you go! Not secret at all. Thanks for linking that!




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: