PEP 661: Sentinel Values

Thanks @taleinat for accepting @Jelle’s offer for help. I have done my (admittedly very small) part with a review of Jelle’s PR.

While reviewing I started to wonder whether the PEP should provide guidance for type checkers on how to handle:

MISSING = sentinel('MISSING')
MISSING = sentinel('MISSING')

It is very contrived but wouldn’t be surprised if this pattern could emerge in very long modules. Is this a redefinition of MISSING that is allowed? Or should this raise an error? Or should each type checker be allowed to choose the behaviour/strictness they want?

I don’t remember this being discussed in this thread, but I think we can all agree that at this point it is quite hard to remember all the various discussions we have had in it :sweat_smile:

1 Like