On Thu, Dec 21, 2017 at 6:39 AM Ivan Levkivskyi <<a href="mailto:levkivskyi@gmail.com">levkivskyi@gmail.com</a>> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="gmail_extra"><div class="gmail_quote"><div>For me, the three options for "don't care" have a bit different meaning:</div><div><br></div><div>* typing.Any: this class is supposed to be used with static type checkers, but this field is too dynamic</div><div>* ... (ellipsis): this class may or may not be used with static type checkers, use the inferred type in the latter case<br></div><div>* "field docstring": this class should not be used with static type checkers</div><div><br></div><div>Assuming this, the second option would be the "real" "don't care". If this makes sense,</div><div>then we can go the way proposed in <a href="https://github.com/python/typing/issues/276" target="_blank">https://github.com/python/typing/issues/276</a> and make ellipsis semantics "official" in PEP 484.</div><div>(pending Guido's approval)</div></div></div></div></blockquote><div dir="auto"><br></div><div dir="auto">I am a little nervous about using "..." for inferred types, because it could potentially cause confusion with other uses of ellipsis in typing.</div><div dir="auto"><br></div><div dir="auto">Ellipsis already has a special meaning for Tuple, so an annotation like MyClass[int, ...] could mean either a tuple subclass with integer elements or a two argument generic type where the second type is inferred. Actually, it's ambiguous even for Tuple.</div><div dir="auto"><br></div><div dir="auto">Ellipsis could also make a lot of sense for typing multi-dimensional arrays similar to how it's used in indexing to denote "any number of dimensions." Again, the semantics for "..." might defer from "an inferred size."</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="gmail_extra"><div class="gmail_quote"><div></div></div></div></div></blockquote></div>