Author gvanrossum
Recipients BTaskaya, Zac Hatfield-Dodds, corona10, gvanrossum, kj, levkivskyi, serhiy.storchaka
Date 2020-11-23.05:32:47
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1606109568.24.0.0565857216349.issue42195@roundup.psfhosted.org>
In-reply-to
Content
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).
History
Date User Action Args
2020-11-23 05:32:48gvanrossumsetrecipients: + gvanrossum, serhiy.storchaka, levkivskyi, corona10, Zac Hatfield-Dodds, BTaskaya, kj
2020-11-23 05:32:48gvanrossumsetmessageid: <1606109568.24.0.0565857216349.issue42195@roundup.psfhosted.org>
2020-11-23 05:32:48gvanrossumlinkissue42195 messages
2020-11-23 05:32:47gvanrossumcreate