Hi,

I'm working on PEP 661: Sentinel Values [1].

One thing I think it should get right is that it should be possible to have strict type annotations for sentinel values. Many sentinel implementations don't support this.

I see that this has come up before on this mailing list [2] and as an issue in the GitHub repo [3].

Using Literal and Final, as suggested in the discussions of the PEP [4] and as suggested by Guido on the aforementioned GitHub issue [5], seems to be a very nice approach.

1. What would be needed to make that work with mypy?
2. What should the process be, in terms of what the PEP defines and what is later implemented in mypy and similar tools?

Please note that I'm far from well-versed on typing in Python, so assume I know only the very basics.

- Tal Einat

[1]: https://www.python.org/dev/peps/pep-0661/
[2]: https://mail.python.org/archives/list/typing-sig@python.org/thread/TI5Y2HTVT6DRUT6R6S7VW4SY5N6ZE4WF/
[3]: https://github.com/python/typing/issues/689
[4]: https://discuss.python.org/t/pep-661-sentinel-values/9126/2
[5]: https://github.com/python/typing/issues/689#issuecomment-561425237