[Python] PEP 0484 - Dubbio

Carlo Miron miron a python.it
Mer 24 Feb 2016 17:29:05 CET


2016-02-24 17:26 GMT+01:00 Piacenza Federico <piacenza.federico a gmail.com>:

> Salve a tutti,oggi mi sono imbattuto nella pep 484 - Type Hints.
>
> ho fatto qualche prova per vedere un po' come funzionava e sono rimasto
> sconcertato dal comportamento seguente:
>
> def pippo(Nome:str):
>    print(Nome)
>
> pippo(23)
>
> mi sarei aspettato un errore legato ad un conflitto tra interi e stringhe ma
> cio non e' accaduto.
>
> Ma a livello semantico le 'Type Hints' non hanno alcun effetto?

Esatto, by design.

㎝

-- 
|:**THE BEER-WARE LICENSE** *(Revision 42)*:
| <miron a python.it> wrote this mail. As long as you retain
| this notice you can do whatever you want with this stuff.
| If we meet some day, and you think this stuff is worth it,
| you can buy me a beer in return.
|                                            --Carlo Miron :


Maggiori informazioni sulla lista Python