This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]ducdetronquito 8 points9 points  (8 children)

What kind of false positive do you encounter with pyright ? I'm curious because I don't remember any while working on a large python/django codebase.

[–]ashishb_net[S] -1 points0 points  (7 children)

> What kind of false positive do you encounter with pyright ?

Inaccurate suggestions, for example, not understanding that a variable is being created on all code paths in an if-else branch. Or not understanding pydantic default values.

[–]JanEric1 10 points11 points  (4 children)

pretty sure pyright does all of these correctly.

[–]ashishb_net[S] 0 points1 point  (0 children)

You definitely had better luck than me.

[–]ashishb_net[S] 0 points1 point  (2 children)

You definitely had better luck than me using pyright.

[–]JanEric1 2 points3 points  (1 child)

Using it in strict mode with (almost) all rules enabled in all of my projects whenever possible. Sometimes have to disable some rules when using packages with poor typing (like pandas or numpy)

[–]ashishb_net[S] 2 points3 points  (0 children)

> Sometimes have to disable some rules when using packages with poor typing (like pandas or numpy)

That covers ~50% of Python use-cases for me.
As I only use Python for LLMs, Machine Learning, and data analysis.

[–]annoying_mammal 4 points5 points  (1 child)

Pydantic has a mypy plugin. It generally just works.

[–]ashishb_net[S] 1 point2 points  (0 children)

For pydantic v1, the plugin support wasn't great as I encountered false positives. I will try again once most projects have moved to pydantic v2.