[Python-Dev] Re: Function Prototypes

2021-12-24 Thread Jim J. Jewett
Steven D'Aprano wrote: > In comparison, Mark's version: > @Callable > def IntToIntFunc(a:int)->int: > pass > # in the type declaration > func: IntToIntFunc > uses 54 characters, plus spaces and newlines (including 7 punctuation > characters); it takes up three extra lines, plus a

[Python-Dev] Summary of Python tracker Issues

2021-12-24 Thread Python tracker
ACTIVITY SUMMARY (2021-12-17 - 2021-12-24) Python tracker at https://bugs.python.org/ To view or respond to any of the issues listed below, click on the issue. Do NOT respond to this message. Issues counts and deltas: open7196 (+16) closed 50706 (+41) total 57902 (+57) Open issues

[Python-Dev] Re: Function Prototypes

2021-12-24 Thread Andrew Svetlov
I like the Callable decorator idea very much. It supports all Python function flavors out of the box, isn't it? Also, what is about allowing to make callable types from existing functions (and even methods maybe) with type hints? def f(a: int, /, b: float) -> str: return str(a*b) F =

[Python-Dev] Re: Function Prototypes

2021-12-24 Thread Serhiy Storchaka
24.12.21 00:09, Guido van Rossum пише: > Without decorator too (that was Lukasz’ idea). Why bother with the > decorator (*if* we were to go there)? It is errorprone. Some library provide function foo() which returns an instance of private type _Foo and people start using it as a type hint. A new