Showing content from http://mail.python.org/pipermail/python-dev/attachments/20150420/be33160f/attachment.html below:
<div dir="ltr"><div>> stub files are only used to type-check *users* of a module. If you want a
module itself to be type-checked you have to use inline type hints<br><br></div>is this a fundamental limitation, or just the current state of tooling?<br></div><div class="gmail_extra"><br><div class="gmail_quote">On 20 April 2015 at 21:48, Harry Percival <span dir="ltr"><<a href="mailto:harry.percival@gmail.com" target="_blank">harry.percival@gmail.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>> "I hate stub files. [...] in my opinion, [it] just about
guarantees a maintenance burden that will fall by the side of the road.<br><br></div>I'm not so pessimistic. It's not like documentation or docstrings or comments -- the whole point is that it should be very easy to have an automated check for whether your stubs are in sync with your source, because both are in code. Unlike docs or comments which can easily become out of date, because there's no automated process to tell you they need updating... I'm thinking of it as a thing your editor will warn you of. Like pyflakes warnings about unused variables & co, I'm never happy until I've silenced them all in a file, and similarly, your editor will keep bugging you until you've got your stubs inline with your code...<br><br></div><div class="gmail_extra"><div><div class="h5"><br><div class="gmail_quote">On 20 April 2015 at 20:37, Isaac Morland <span dir="ltr"><<a href="mailto:ijmorlan@uwaterloo.ca" target="_blank">ijmorlan@uwaterloo.ca</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span>On Mon, 20 Apr 2015, Paul Moore wrote:<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
On 20 April 2015 at 19:41, Barry Warsaw <<a href="mailto:barry@python.org" target="_blank">barry@python.org</a>> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
tldr; type hints in python source are scary. Would reserving them for stub<br>
files be better?<br>
</blockquote>
<br>
I think so. I think PEP 8 should require stub files for stdlib modules and<br>
strongly encourage them for 3rd party code.<br>
</blockquote>
<br>
Agreed. I have many of the same concerns as Harry, but I wouldn't have<br>
expressed them quite as well. I'm not too worried about actually<br>
removing annotations from the core language, but I agree that we<br>
should create a strong culture of "type hints go in stub files" to<br>
keep source files readable and clean.<br>
<br>
On that note, I'm not sure "stub" files is a particularly good name.<br>
Maybe "type files" would be better? Something that emphasises that<br>
they are the correct place to put type hints, not a workaround.<br>
</blockquote>
<br></span>
How about "header" files?<br>
<br>
(ducks...)<br>
<br>
Isaac Morland      CSCF Web Guru<br>
DC 2619, x36650Â Â Â Â Â WWW Software Specialist<div><div><br>
_______________________________________________<br>
Python-Dev mailing list<br>
<a href="mailto:Python-Dev@python.org" target="_blank">Python-Dev@python.org</a><br>
<a href="https://mail.python.org/mailman/listinfo/python-dev" target="_blank">https://mail.python.org/mailman/listinfo/python-dev</a><br>
Unsubscribe: <a href="https://mail.python.org/mailman/options/python-dev/hjwp2%40cantab.net" target="_blank">https://mail.python.org/mailman/options/python-dev/hjwp2%40cantab.net</a><br>
</div></div></blockquote></div><br><br clear="all"><br></div></div><span class="HOEnZb"><font color="#888888">-- <br><div>------------------------------<br>Harry J.W. Percival<br>------------------------------<br>Twitter: @hjwp<br>Mobile:Â +44 (0) 78877 02511<br>Skype:Â Â Â Â Â harry.percival</div>
</font></span></div>
</blockquote></div><br><br clear="all"><br>-- <br><div class="gmail_signature">------------------------------<br>Harry J.W. Percival<br>------------------------------<br>Twitter: @hjwp<br>Mobile:Â +44 (0) 78877 02511<br>Skype:Â Â Â Â Â harry.percival</div>
</div>
RetroSearch is an open source project built by @garambo
| Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4