<div dir="ltr">Hi!<br><div class="gmail_extra"><br><div class="gmail_quote">2017-11-26 4:31 GMT+03:00 Juan Nunez-Iglesias <span dir="ltr"><<a href="mailto:jni.soma@gmail.com" target="_blank">jni.soma@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">



<div>
<div name="messageReplySection" style="font-size:14px;font-family:-apple-system,BlinkMacSystemFont,sans-serif"><span class="gmail-"><br>
On 26 Nov 2017, 12:27 PM +1100, Nathaniel Smith <<a href="mailto:njs@pobox.com" target="_blank">njs@pobox.com</a>>, wrote:<br>
<blockquote type="cite" style="margin:5px;padding-left:10px;border-left:thin solid rgb(26,188,156)">It turns out that the PEP 484 type system is *mostly* not useful for<br>
this. They're really designed for checking consistency across a large<br>
code-base, not for enabling compiler speedups. For example, if you<br>
annotate something as an int, that means "this object is a subclass of<br>
int". This is enough to let mypy catch your mistake if you<br>
accidentally pass in a float instead, but it's not enough to tell you<br>
anything at all about the object's behavior -- you could make a wacky<br>
int subclass that acts like a string or something. </blockquote></span></div></div></blockquote><div><br></div><div>I have subscribed to many lists, although I am not an active participant in them. Nevertheless this topic of using the type annotation in their projects was discussed several times on all Cython-like channels (and it becomes much more acute now days). "Misconceptions" arise both for ordinary users and developers, but I have never seen anyone to write clearly why the application of type annotation in Cython (and similar projects) is impossible or not reasonable. Maybe someone close to the topic has the time and energy to sum up and write a brief summary of how to perceive them and why they should be viewed "orthogonal"?</div><div><br></div><div><div>Maybe I'm looking too superficially at this topic. But both Mypy and Cython perform type checking. From the Cython point of view I do not see any pitfalls, type checking and type conversions are what Cython is doing right now during compilation (and looks at types as strictly as necessary).</div><div>From Mypy's point of view, it's possible that it can delegate all this stuff, using a certain option, on a project's related type checker (which can be much stricter in its assumptions)</div></div><div><br></div><div>With kind regards, -gdg</div><div><br></div><div><br></div><div><br></div></div><br></div></div>