DEV Community

loading...

Discussion on: Why I started using Python type annotations, and why you should too

Collapse
florimondmanca profile image
Florimond Manca Author

Thanks! It's a shame that Spyder doesn't support type checking. I know Atom doesn't either (I use Atom at home and PyCharm at work) but it manages to use the annotations for autocompletion (i.e. displaying methods of an object annotated as a certain class), which is already pretty handy. Does Spyder's autocompletion support this as well?

If I may, I'm not sure "strong typing" is the correct word there — Python is a very strongly typed language. Everything has a type, even the type object itself!
However it is does not have "true" static typing, yet — and I don't think it ever should. Adding attributes/methods at runtime is one of the most powerful things dynamic typing allows, and that would have to go away with static typing.
However, if a very optional and controllable way of saying "this variable should never be assigned to a variable of type other than XYZ", I'd be interested as well. Not sure how much overhead that would create, though, as the interpreter would have to do checks on every assignments.
If you have resources on forecast static typing features for Python 4, I'd be glad to check them out! :)

Collapse
matyashvladislav profile image
Forem Open with the Forem app