PEP 661: Sentinel Values

I don’t think type annotations has to be tied to the implementation. FWIW, last I checked (and this may be horribly outdated information), mypy doesn’t derive type information from the standard library’s source code directly, but looks at stubs in typeshed. typeshed[1] is universally supported by other type checkers, so type information can always be added there instead of tying them to the stdlib’s source. There’s also some previous discussions (with no consensus) on whether to add type hints to the stdlib[2].

Anyways, I hope I didn’t come off as bike shedding, just wanted to say that I think you don’t have to decide this when finalizing the implementation either - there are other ways :). And once again thanks for bringing this PEP to life.

[1] typeshed/stdlib at master · python/typeshed · GitHub
[2] Type annotations in the standard library

1 Like