<div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Jun 30, 2021 at 8:07 PM Stefan van der Walt <<a href="mailto:stefanv@berkeley.edu">stefanv@berkeley.edu</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On Wed, Jun 30, 2021, at 09:03, Evgeni Burovski wrote:<br>
> ISTM it's important that annotations are optional in the sense that we<br>
> do not explicitly require that new code is typed. If someone is<br>
> willing to add them, great (and if someone is willing to review a<br>
> typing PR, even better :-)). But this should be possible to do in a<br>
> follow-up PR, not as a requirement for an enhancement PR.<br>
<br>
I agree, especially given that the typing notation is still changing.  For example, they're currently working out a shorthand for typing function definitions (and I'm sure other simplifications are in the pipeline too).<br></blockquote><div><br></div><div>That is the current state, and I agree it should stay like that.</div><div> <br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
I'd still like to find proof that typing has significant impact.  </blockquote><div><br></div><div>Consider this: having type annotations + mypy would have prevented writing np.matrix, and we would have sane ndarray subclassing. I think that's the main impact. Finding bugs it doesn't help much with (and the ones it does catch are usually easy ones).</div><div><br></div><div>Cheers,<br></div><div>Ralf</div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">There have been some studies in JavaScript land that give rough metrics like "1/6 bugs could have been identified with typing" [0].  But then you see the Flask team annotating their entire project and finding almost none; probably because in Python we tend to test differently.  We also tend to have more functional interfaces that return straightforward built-in objects.<br>
<br>
For now, I feel typing still mostly benefits IDE users.  Perhaps in the future we'll see the accelerated frameworks Tyler referred to using it as well.<br>
<br>
Stéfan<br>
<br>
[0] <a href="https://earlbarr.com/publications/typestudy.pdf" rel="noreferrer" target="_blank">https://earlbarr.com/publications/typestudy.pdf</a><br>
_______________________________________________<br>
SciPy-Dev mailing list<br>
<a href="mailto:SciPy-Dev@python.org" target="_blank">SciPy-Dev@python.org</a><br>
<a href="https://mail.python.org/mailman/listinfo/scipy-dev" rel="noreferrer" target="_blank">https://mail.python.org/mailman/listinfo/scipy-dev</a><br>
</blockquote></div></div>