I'm -1 on 'any' for 'Any', but +0.5 on 'callable' for 'Callable' -- IIRC, Callable was the next most commonly used thing imported from typing (after, Dict, List etc. which were handled by PEP 585).


On Wed, Nov 30, 2022 at 12:37 AM Shantanu Jain <hauntsaninja@gmail.com> wrote:
Yes, that has been discussed, e.g. https://github.com/python/cpython/issues/86268

PEP 677 would have provided an alternative syntax for Callable, but the PEP was rejected.

In case anyone cares, my opinion on the matter is:
  • builtins.any and typing.Any are too semantically different to share a symbol (you can subclass Any in 3.11!)
  • builtins.callable and typing.Callable are at least vaguely the same concept, so it's worth thinking about. For now I'm kind of -0 on it (and reserve the right to change my mind)... the status quo isn't terrible, callable is still somewhat different from Callable (unlike PEP 585 builtins), the import is not the worst thing about Callable, it may have a runtime cost, many IDEs have decent support for auto-importing, things may change (e.g. it would definitely have been a mistake if I'd made the change^^ and then PEP 677 had gotten accepted), etc

I wouldn't say it's a long term goal to cover all typing use cases without imports. In cases where static typing being bolted on to a 30 year old language causes a lot of usability pain, we should aspire to improve things. But dedicated syntax and changes to builtins are about the most far-reaching changes you can make to Python, so some circumspection is wise, potential costs are relatively high, potential benefits in this case are at most medium.

On Tue, 29 Nov 2022 at 23:43, Maciej M <maciej.mikulski.jr@gmail.com> wrote:
What about `callable` vs `Callable`? Was it already discussed?

I don't think that you were shot down. You simply met a few people who didn't like the change. I think that the long term goal is to cover all typing use cases without a need for imports and that would be a step in this direction.
_______________________________________________
Typing-sig mailing list -- typing-sig@python.org
To unsubscribe send an email to typing-sig-leave@python.org
https://mail.python.org/mailman3/lists/typing-sig.python.org/
Member address: hauntsaninja@gmail.com
_______________________________________________
Typing-sig mailing list -- typing-sig@python.org
To unsubscribe send an email to typing-sig-leave@python.org
https://mail.python.org/mailman3/lists/typing-sig.python.org/
Member address: guido@python.org


--
--Guido van Rossum (python.org/~guido)
Pronouns: he/him (why is my pronoun here?)