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 <[email protected]> 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 -- [email protected] To unsubscribe send an email to [email protected] https://mail.python.org/mailman3/lists/python-ideas.python.org/ Message archived at https://mail.python.org/archives/list/[email protected]/message/W6KHBGAVKZUNMDXLHJHOOEY2LX4P7K5T/ Code of Conduct: http://python.org/psf/codeofconduct/
