<div dir="ltr"><pre style="background-color:rgb(255,255,255);color:rgb(0,0,0);font-family:"Courier New""><span style="color:rgb(0,0,255);font-weight:bold"><font color="#000000">Salve a tutti,oggi mi sono imbattuto nella pep 484 - </font></span><span style="color:rgb(0,0,255);font-weight:bold"><font color="#000000">Type Hints.<br><br>ho fatto qualche prova per vedere un po' come funzionava e sono rimasto sconcertato dal comportamento seguente:<br><br></font>def </span><span style="color:rgb(225,0,225);font-weight:bold">pippo</span>(Nome:<span style="color:rgb(0,0,128)">str</span>):<br>   <span style="color:rgb(0,0,128)">print</span>(Nome)<br><br>pippo(<span style="color:rgb(0,0,255)">23</span>)<br><br></pre><pre style="background-color:rgb(255,255,255);color:rgb(0,0,0);font-family:"Courier New""><span style="color:rgb(0,0,255);font-weight:bold"><font color="#000000">mi sarei aspettato un errore legato ad un conflitto tra interi e stringhe ma cio non e' accaduto.<br><br></font></span></pre><pre style="background-color:rgb(255,255,255);color:rgb(0,0,0);font-family:"Courier New""><span style="color:rgb(0,0,255);font-weight:bold"><font color="#000000">Ma a livello semantico le '</font></span><span style="color:rgb(0,0,255);font-weight:bold"><font color="#000000">Type Hints' non hanno alcun effetto?<br><br></font></span></pre><pre style="background-color:rgb(255,255,255);color:rgb(0,0,0);font-family:"Courier New""><span style="color:rgb(0,0,255);font-weight:bold"><font color="#000000">grazie a tutti<br></font></span></pre></div>