Python type hints

PhilipDAth
Kind of a big deal
Kind of a big deal

Python type hints

Does anyone use Python type hints?

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

6 Replies 6
RaphaelL
Kind of a big deal
Kind of a big deal

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
Head in the Cloud

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 😃

PhilipDAth
Kind of a big deal
Kind of a big deal

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

Greenberet
Head in the Cloud

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

PhilipDAth
Kind of a big deal
Kind of a big deal

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).

Greenberet
Head in the Cloud

Visual Studio & Visual Studio Code depending on the usecase

Get notified when there are additional replies to this discussion.