datatrees v0.3.2: better static typing with Pylance

The datatree decorator now utilizes typing.dataclass_transform. This allows static analysis tools to correctly recognize it as a dataclass-like decorator, enabling proper inference of the generated __init__ method.

Pylance still does not recognize datatrees Node fields (field injection) and calling Nodes (field binding) yet.

submitted by /u/GianniMariani to r/Python
[link] [comments]


Commentaires

Laisser un commentaire

Votre adresse e-mail ne sera pas publiée. Les champs obligatoires sont indiqués avec *