Why do we have Literal type in the typing module? I sure can use them as types 
to indicate to the user "these are your only options”? 

> On 6 Feb 2022, at 2:18 AM, Steven D'Aprano <st...@pearwood.info> wrote:
> 
> he bottom line here is that we cannot use literals as types because 
> they aren't types, they are values, and the semantics of operations on 
> types and operations on values are different.

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

Reply via email to