External typing systems or typing subsystems

Thanks @mikeshardmind. I’ve read the PEPs a few times in the past. So while none of the above terms are 100% new to me, using them in discussing a real problem is new, and I really appreciate you taking the time to help me understand the weeds. Please do use the jargon :smile:

Type intersection seems useful, and I’m glad to hear people are working on it (just saw the proposal discussion)! The workaround using type intersections seems the best yet.

The problem I see with NewType on protocol is a bit thorny, Protocols use structural subtyping, not nominal. NewType relies on the semantics of nominal subtyping (jargon below).

Mixing the two here is a bit hard …

Is the concern that NewType of a protocol wouldn’t be able to guarantee Liskov Substitution fully, and thus mixing structural and nominal subtyping would make it unclear what type safety guarantees a static analyzer should provide? I’ll scratch my head and see if I can come up with an example.