<div dir="ltr"><div dir="ltr"><br></div><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sat, Mar 23, 2019 at 11:00 AM Stefan Krah <<a href="mailto:skrah@bytereef.org">skrah@bytereef.org</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 Sat, Mar 23, 2019 at 10:37:43AM -0700, Gregory P. Smith wrote:<br>
> A useless statement like that isn't likely to be typed.  I've never seen<br>
> anyone do that.<br>
<br>
Unlikely yes, but ideally type annotations should not alter program behavior:<br>
<br>
>>> d = {}<br>
>>> try: d["x"]<br>
... except KeyError: print("KeyError")<br>
... <br>
KeyError<br>
>>> <br>
>>> d = {}<br>
>>> try: d["x"] : int<br>
... except KeyError: print("KeyError")<br>
... <br></blockquote><div><br></div><div>Unfortunately that isn't what PEP 526 said: <a href="https://www.python.org/dev/peps/pep-0526/#annotating-expressions">https://www.python.org/dev/peps/pep-0526/#annotating-expressions</a></div><div><br></div><div>-gps</div></div></div>