
May 16, 2016
2:53 p.m.
On Sun, May 15, 2016 at 8:20 PM, Stephen J. Turnbull <stephen@xemacs.org> wrote:
But I shouldn't have taken the OP's Union[bytes,str] seriously. In fact the os.path functions and other such functions are defined with AnyStr, which is a *variable* type, not a Union type. In typeshed, we write
If you mean my OP in the other thread, I was indeed just introducing the readers (potentially not familiar with PEP 484, mypy etc.) to the basic concepts such as Unions and TypeVars while going towards the actual proposal at the very end of the post, which was to avoid having to go from TypeVars "back to" Unions in os.fspath and os.path functions. -- Koos