Interesting point, it's not something I thought of. One solution as mentioned 
by Simão, and what I had in mind, is to pull the type from the first parameter 
of the function. We know that the function is always going to have minumum 1 
parameter, and the value is always passed as the first argument.
One downside is that it isn't very transparent to the user - they might not 
understand that the type is being taken from the first argument of the 
function, and wonder where it is coming from, in which case, the other solution 
would be to do something like `InitVar` but that takes two types (the return 
and the init type); something like `var: InitFn[int, str]` for the `chr` 
example.
_______________________________________________
Python-ideas mailing list -- python-ideas@python.org
To unsubscribe send an email to python-ideas-le...@python.org
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at 
https://mail.python.org/archives/list/python-ideas@python.org/message/I6Y2IAYMB3TTJQGFFAMBQXM2G6Z7ZWOG/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to