4 ms·
This does seem like an abstraction leak though.
by sanderjd 5mo ago
This does seem like an abstraction leak though.
- whilenot-dev 5mo agoThe abstraction gets leaky once you expect the distinct NewTypes to adhere to the original inheritance property. I think that's a wrong assumption from the get-go. OP could just do: def foo(val: _A) -> None: pass ...and it'll accept both NewTypes just fine. I guess it depends on whether foo is designed to be public or private.
- sdeframond 5mo agoThis works but it does not let other modules define such methods.