<div dir="ltr"><div>I think adding type hints to docstrings is a fine thing to do if any given developer wants to. I don't think we should have a policy requiring it or prohibiting it.<br></div><div><br></div>Note that the PEP states these type hints are for static analysis not runtime type checking. Besides the pep's stance on that, I don't think CPython supports runtime type checking based on these types. Since vim and PyCharm support the static analysis already, if it were to be used, we would derive the value it creates right away.<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Jun 19, 2017 at 3:20 PM, Daniel Alley <span dir="ltr"><<a href="mailto:dalley@redhat.com" target="_blank">dalley@redhat.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div>For what it's worth, Pycharm does support PEP 484 type hinting.<br><br><a href="https://www.jetbrains.com/help/pycharm/type-hinting-in-pycharm.html" target="_blank">https://www.jetbrains.com/<wbr>help/pycharm/type-hinting-in-<wbr>pycharm.html</a><br><a href="https://blog.jetbrains.com/pycharm/2015/11/python-3-5-type-hinting-in-pycharm-5/" target="_blank">https://blog.jetbrains.com/<wbr>pycharm/2015/11/python-3-5-<wbr>type-hinting-in-pycharm-5/</a><br><br></div>There are also projects like MyPy which behave like static analyzers.<br><br></div>It is theoretically possible to continue supporting Python 3.3-3.4 if we were to put all of the type annotations into .pyi stub files, but I personally dislike that idea strongly because it would result in a lot of duplication.<br></div><div class="gmail_extra"><br><div class="gmail_quote"><div><div class="h5">On Mon, Jun 19, 2017 at 2:55 PM, David Davis <span dir="ltr"><<a href="mailto:daviddavis@redhat.com" target="_blank">daviddavis@redhat.com</a>></span> wrote:<br></div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5"><div dir="ltr">Recently we switched to using Google style docstrings. I was looking through the docs and saw that it supported type hinting (see function_with_types_in_do<wbr>cstring vs function_with_pep484_type_anno<wbr>tations):<div><div><br></div><div><a href="http://sphinxcontrib-napoleon.readthedocs.io/en/latest/example_google.html" target="_blank">http://sphinxcontrib-napoleon.<wbr>readthedocs.io/en/latest/examp<wbr>le_google.html</a><br clear="all"><div><div class="m_-5521984608787388846m_-6246625771355665418gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><br></div><div>Unless I am mistaken, declaring functions using type hinting seems like no extra effort than declaring types in our docstring. I am wondering now might be a good time to consider using type hinting given that Pulp 3 is still fairly new?</div><div><br></div><div><div>For more information about type hinting, check out PEP484:</div><div><br></div><div><a href="https://www.python.org/dev/peps/pep-0484/" target="_blank">https://www.python.org/dev/pep<wbr>s/pep-0484/</a></div></div><div><br></div><div>One concern I have about type hinting though is its newness. It’s only been around since Python 3.5 which also means Pulp 3 would have to require 3.5+. And it doesn’t look like there are many tools that leverage type hinting currently.</div><div><br></div><div>Thoughts?</div><span class="m_-5521984608787388846HOEnZb"><font color="#888888"><div><br></div><div>David<br></div></font></span></div></div></div></div></div></div></div>
</div></div></div>
<br></div></div>______________________________<wbr>_________________<br>
Pulp-dev mailing list<br>
<a href="mailto:Pulp-dev@redhat.com" target="_blank">Pulp-dev@redhat.com</a><br>
<a href="https://www.redhat.com/mailman/listinfo/pulp-dev" rel="noreferrer" target="_blank">https://www.redhat.com/mailman<wbr>/listinfo/pulp-dev</a><br>
<br></blockquote></div><br></div>
<br>______________________________<wbr>_________________<br>
Pulp-dev mailing list<br>
<a href="mailto:Pulp-dev@redhat.com">Pulp-dev@redhat.com</a><br>
<a href="https://www.redhat.com/mailman/listinfo/pulp-dev" rel="noreferrer" target="_blank">https://www.redhat.com/<wbr>mailman/listinfo/pulp-dev</a><br>
<br></blockquote></div><br></div>