[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Typing, how come that :int is not ensuring int parameter?

On 12/06/20 9:32 AM, zljubisic at wrote:
> OK, as I can see nothing is enforced but I can use mypy and tests for the purpose.

Exactly! Well done - Python uses 'duck typing' and thus when the Typing 
module was added, it became an option. As mentioned elsewhere, it 
provides "hints" at 'compile time'.

> As I am using pycharm, looks like I need a plugin for mypy.
> There are two of them out there:
> non official:
> and official:
> Do you have any experience with any of these plugins?
> Please share your opinion.

I don't have a competent opinion for the current Pycharm, but hope that 
others will answer.

TBH I'd be surprised if it doesn't come 'baked in'.
Regards =dn