
I'm not sure I fully understand the terminology you're using. Can you explain what you mean by "value unions" versus "argument unions"? Those terms aren't part of the Python typing lexicon currently (at least to my knowledge), but it sounds like you see this as an important distinction. There have been deep discussions about supporting a variant of TypeGuard that supports narrowing in the negative case but is more limited than the existing PEP 647 `TypeGuard`. See https://github.com/python/typing/discussions/1013#discussioncomment-1966238 for a concrete proposal for a variant called `StrictTypeGuard`. Rebecca Chen (member of the pytype team) presented this idea at the 2020 PyCon Typing Summit (https://us.pycon.org/2022/events/typing-summit/), so you may want to watch the recording of that session. I think this idea be consistent with your `TotalTypeGuard` concept. I've implemented the proposed `StrictTypeGuard` in pyright, so you can try it today. `StrictTypeGuard` won't work at runtime because there is no runtime support currently, but it will work at type checking time. So far, support for `StrictTypeGuard` has been somewhere between positive and lukewarm within the typing community. I don't recall any significant negative feedback about the proposal, but no one has stepped up yet to shepherd the proposal through the standardization process. If someone is strongly motivated to push it further, I think the next step would be to write a formal PEP. Eric Traut Contributor to pyright & pylance Microsoft