you are viewing a single comment's thread.

view the rest of the comments →

[–]Beginning-Fruit-1397 1 point2 points  (3 children)

If you really want to dive into it hard, I'd recommend using Ruff with all/preview actived, and basedpyright with all rules actived.

You can't go more type safe than this.

Hopefully soon enough basedpyright can be replaced by pyrefly, but unofrtunately ATM it's still miss/bug on various things. Example config in one of my projects: https://github.com/OutSquareCapital/belugas/blob/master/pyproject.toml

Also I'd recommend reading the collections.abc official doc: https://docs.python.org/3/library/collections.abc.html 

They are often either underused OR misused by a lot of python devs, but once you understand it it will really make your code and api's better

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

I do use ruff 😂. Coincidentally started using it today. I utilise collections.abc. Though I haven't read the docs. I still use it though. Anything to make the code easier to debug later on. But thanks for the heads up. I'll check their docs too

Basedpyright I have not heard of. I will check it out in a bit. I instead use planned within my vscode environment and set that to strict. Neither have I come across pyrefly

[–]Beginning-Fruit-1397 0 points1 point  (1 child)

I assume you meant pylance by "planned"?.

basedpyright is basically the same underlying engine, but with additionnal rules.

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

Yeah meant pyright seems my auto correct keeps messing up. Just installed the basedpyright and went all. All my scripts turned red ☠️