a<callable: (int, int) -> int>I like this option best of the ones Guido gave (though I don't like the colon — but that's a minor nit). It's readable and consistent with the repr() of `inspect.Signature` objects. It's also clear, however, that it's representing something different from `inspect.Signature`.I wonder, though: does this feature have any use cases outside of type-hinting/variable annotations? If not, should the repr of these objects have some indication of that? A newbie to Python might (understandably) assume from this repr that these objects are... callable. Having the word "callable" in the repr might also breed confusion with the builtin `callable` function, as well, perhaps?Not sure I can think of anything better, however. Best, Alex -------- Original message --------From: Guido van Rossum <guido@python.org> Date: 27/10/2021 16:52 (GMT+00:00) To: None via Typing-sig <typing-sig@python.org>, S Pradeep Kumar <gohanpra@gmail.com> Subject: [Typing-sig] repr() of callable type Regardless of whether we pick shorthand, longhand or hybrid form, we need to decide on what the repr() of such an object would be. E.g. in an interactive session, if I print a callable type object, what will it print?>>> a = (int, int) -> int>>> a(int, int) - int>>> or perhaps>>> a(__0: int, __1: int, /) -> int>>> or maybe>>> acallable[[int, int], int]>>>
or>>> a<callable: (int, int) -> int>>>> ???-- --Guido van Rossum (python.org/~guido)Pronouns: he/him (why is my pronoun here?)