[Python-ideas] Re: Typing Callable Ellipsis -- support for type hints a la Callable[[int, float, ...], None]

2021-09-22 Thread Guido van Rossum
This is a question for typing-sig.

Over on typing-sig we are looking at alternatives to Callable, so it's
unlikely that any changes to Callable itself will be accepted.

Instead of `...`, we will probably use `*args`, similar to what is used in
the `def` syntax.

Feel free to peruse the typing-sig archives to learn more about the current
status:
https://mail.python.org/archives/list/typing-...@python.org/

--Guido

On Wed, Sep 22, 2021 at 1:04 AM Randolf Scholz 
wrote:

> @Valentin Berlier
>
> That would probably be possible, but the question here is, given that
> `Callable` is a built-in, is it sensible to expect `Callable` to support
> this behaviour.
>
> I would say yes, because it is extremely intuitive, especially with
> regards to the fact that the widely used numpy library already uses
> Ellipsis in a fashion semantically consistent with this proposal.
> ___
> 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/L6BTMIIMNSXX37YQA7J5VCOI7TOKOX5O/
> Code of Conduct: http://python.org/psf/codeofconduct/
>


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

___
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/WE6MSPQNAKZIBNBJ3IN5MIKO6E7NIIV5/
Code of Conduct: http://python.org/psf/codeofconduct/


[Python-ideas] Re: Typing Callable Ellipsis -- support for type hints a la Callable[[int, float, ...], None]

2021-09-22 Thread Randolf Scholz
@Valentin Berlier

That would probably be possible, but the question here is, given that 
`Callable` is a built-in, is it sensible to expect `Callable` to support this 
behaviour.

I would say yes, because it is extremely intuitive, especially with regards to 
the fact that the widely used numpy library already uses Ellipsis in a fashion 
semantically consistent with this proposal.
___
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/L6BTMIIMNSXX37YQA7J5VCOI7TOKOX5O/
Code of Conduct: http://python.org/psf/codeofconduct/


[Python-ideas] Re: Typing Callable Ellipsis -- support for type hints a la Callable[[int, float, ...], None]

2021-09-21 Thread Valentin Berlier
You can do that with a custom protocol 
https://docs.python.org/3/library/typing.html#typing.Protocol
___
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/OHODQQX2TREFRTOVRIFYVQSLKGB2MVZI/
Code of Conduct: http://python.org/psf/codeofconduct/