cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
3161
Views
6
Helpful
6
Replies

Python type hints

Philip D'Ath
Meraki Community All-Star
Meraki Community All-Star

Does anyone use Python type hints?

https://docs.python.org/3/library/typing.html

6 Replies 6

Raphael_L
Meraki Community All-Star
Meraki Community All-Star

Haven't used that in all my Meraki projects. I'm familiar with it, but haven't seen the benefits of "complicating" my code. I find it a bit harder to read imo.

Greenberet
Level 8
Level 8

I'm using it in most of my projects. It helps to understand what to expect from which function.
Really usefull for migrations, when you are e.g. creating an object and in the past it was just some dict/json.
-> So does function xy use the old or the new way? Type hint will let you know 😃

Philip D'Ath
Meraki Community All-Star
Meraki Community All-Star

So you are using it with human validation only, rather than with external tooling?

well I've enabled "basic" type hint warnings in the IDE =D

Philip D'Ath
Meraki Community All-Star
Meraki Community All-Star

That is another good question. Which IDE do you use?

I tend to use either IDLE or a text editor called UltraEdit (which I use for many other things).

Visual Studio & Visual Studio Code depending on the usecase