<div dir="ltr"><div dir="ltr"><div class="gmail_default" style="color:rgb(0,0,0)"><span style="color:rgb(34,34,34)">On Tue, Oct 9, 2018 at 3:16 AM Ivan Levkivskyi <<a href="mailto:levkivskyi@gmail.com">levkivskyi@gmail.com</a>> wrote:</span><br></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div class="gmail_quote"><div dir="ltr">class PathLike(Protocol[AnyStr]):<br></div></div></div></blockquote><div> </div><div><div class="gmail_default" style="color:rgb(0,0,0)">I had been working on this same problem intermittently for several months, so thanks, but...</div><br></div><div class="gmail_default" style="color:rgb(0,0,0)">    error: Invariant type variable 'AnyStr' used in protocol where covariant one is expected</div><div class="gmail_default" style="color:rgb(0,0,0)"><br></div><div class="gmail_default" style="color:rgb(0,0,0)">is called out on the class  by mypy 0.630 (Python 3.6.6).  Do I just need to wait for 0.640?  Or should I define a new TypeVar for AnyStr_co and use that?</div><div class="gmail_default" style="color:rgb(0,0,0)"></div></div></div></div>