Guido van Rossum <gu...@python.org> added the comment:

I'm still not sold on __args__ == (Tuple[int, int], str); it looks too weird.

However if we introduced a new private type for this purpose that might work? I 
see that the definition of Tuple in typing.py is

Tuple = _TupleType(tuple, -1, inst=False, name='Tuple')

Maybe we could do something like

_PosArgs = _TupleType(tuple, -1, inst=False, name='_PosArgs')

?

Then __args__ could be (_PosArgs[int, int], str).

However this still leaves collections.abc.Callable different. (We really don't 
want to import typing there.)

Then again, maybe we should still not rule out ((int, int), str)? It feels less 
hackish than the others.

And yet another solution would be to stick with (int, int, str) and change 
collections.abc.Callable to match that. Simple, and more backward compatible 
for users of the typing module (since no changes at all there).

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue42195>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to