r/learnpython • u/FC-AC_play • Jul 30 '25
What is pylance bad?
Is pylance bad and is it actually better or is it just marketting? Just started to learn Python, it adds more chaos to my work then actual being useful
11
u/skwyckl Jul 30 '25
It's not bad, in 99% of the cases it turns Python into a safe-enough language to build large, complex systems. Sure, none of the checks is enforced in any way (Python has no compiler), but during development you can find and address type mismatches. It is bad if and only if a library you are using doesn't have stub files. In that case it's just noise.
4
u/Gnaxe Jul 30 '25
The checks are enforced if your pipeline enforces them. It's true that many static type-only languages refuse to compile if they detect a type error, but this isn't true of Roc, for example. Python isn't the only gradually typed language either. TypeScript is another example.
You're also wrong about Python not having a compiler. Native compilers exist, and even the so-called interpreted implementations compile to bytecode first and interpret that. I'm not just being pedantic. There's literally a
compile()builtin to compile Python. Python has a compiler.1
u/sausix Jul 30 '25
It's not about a program is being compiled or not. You can compile Python code natively and it will change nothing.
And there can even be interpreted languages that only allow strict types being memory friendly.
It's about type safety itself. Python does not work with native low level datatypes but instead with objects.
2
u/skwyckl Jul 30 '25
Fair, didn't know about that, I use Python for data mostly, but my main langs are others :-)
1
u/sausix Jul 30 '25
All fine. I also learn new things all the time here.
And it's not a shame to use other programming languages too ;-)
2
u/FC-AC_play Jul 30 '25
Thanks to all.
Somehow Pylance adding 1 extra space every time I hit Enter after creating function.
It has 5 spaces in status bar. Like automatic 4 spaces (that's normal behaviour) and then I see something adding + 1 additional whitespaces in 0.1 sec. It blows my mind to delete one whitespace every time
After deleting Pylance the problem is gone. Although now I am missing all Pylance functionality....
Here is screenshot
https://www.reddit.com/r/vscode/comments/1md9j8u/vs_code_adds_an_extra_space_on_new_line/