
June 8, 2021
6:54 p.m.
On Tue, 2021-06-08 at 20:40 +0200, Sebastian Rittau wrote:
Unless I misunderstand something (quite possible!), the following idiom does not currently work with type checkers and is not supposed to work: X = foo() def bar(x: Literal[X]) -> None: ... This means that "X = sentinel()" would need to be special-cased.
Why can't a sentinel class itself be used? Why would it need to be instantiated? Paul