<div dir="ltr"><div class="gmail_quote"><div dir="ltr">On Wed, May 4, 2016 at 10:59 AM Chris Angelico <<a href="mailto:rosuav@gmail.com">rosuav@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On Thu, May 5, 2016 at 12:36 AM, David Mertz <<a href="mailto:mertz@gnosis.cx" target="_blank">mertz@gnosis.cx</a>> wrote:<br>
> The thing that nudged me to -1 is code something like the following, which<br>
> I've actually written for completely valid use-cases:<br>> def code_generate(data_source, output=open('data.py','w')):<br><br>
This is a way of catching compile-time-detectable errors. Python has<br>
generally been pretty helpful with that kind of thing, even to the<br>
point of special-casing print-used-as-a-statement to tell you to put<br>
parens around it. While I fully understand that there are reasons<br>
against doing this (including "that's the job of linters, not the core<br>
language"), I do _not_ understand the apparent attitude that it's a<br>
fundamentally bad thing to do. Most cases where a dict display is<br>
used, it's intended to have unique keys.<br></blockquote><div><br></div><div><span style="line-height:1.5">You accidentally snipped out Mertz' statement that he didn't want the interpreter to complain about "probably-bad" patterns. This implies the distinction that linters should complain about probably-bad things while the interpreter only complains about always-bad things.</span></div><div><span style="line-height:1.5"><br></span></div><div><span style="line-height:1.5">I guess you could argue that warnings exist so that the interpreter can complain about probably-bad things as well. If that's what you'd like, we shouldn't call it a "compile-time-detectable error" but instead, uh, ... hard to find the right vocabulary here.</span></div></div></div>