<div dir="ltr">On 1 September 2016 at 18:21, Steven D'Aprano <span dir="ltr"><<a href="mailto:steve@pearwood.info" target="_blank">steve@pearwood.info</a>></span> wrote:<br><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">The simplest way would be to say "go on, one type hint won't hurt,<br>
there's no meaningful runtime cost, just do it".<br>
<br>
from typing import Any<br>
<br>
class X:<br>
  Â  NAME: Any<br>
<br>
Since I'm not running a type checker, it doesn't matter what hint I use,<br>
but Any is probably the least inaccurate.<br>
<br>
But I think there's a better way.<br>
<br>
Unless I've missed something, there's no way to pre-declare an instance<br>
attribute without specifying a type. (Even if that type is Any.) So how<br>
about we allow None as a type-hint on its own:<br>
<br>
  Â  NAME: None<br>
<br>
as equivalent to a declaration *without* a hint. The reader, and the<br>
type-checker, can see that there's an instance attribute called NAME,<br>
but in the absense of an actual hint, the type will have to be inferred,<br>
just as if it wasn't declared at all.<br></blockquote><div><br></div><div>There is a convention for function annotations in PEP 484 that a missing annotation<br></div><div>is equivalent to Any, so that I like your first option more.<br><br>--<br></div><div>Ivan  <br></div></div><br></div></div>