
I just merged a SequenceNotStr type into phantom-types, I'll release that in 0.16 soon. https://phantom-types.readthedocs.io/en/main/pages/types.html#module-phantom... https://github.com/antonagestam/phantom-types/pull/194 Sorry for the lack of response to your questions in this thread.
What has the feedback been so far? Is it getting significant uptake? Do you know if it has been adopted in any large code bases other than your own?
No not really, there has been some interest but nothing I would call a significant uptake. We are using it in large code bases at work and thus far we've seen no problems. There hasn't been that many interactions on Github, but I've received some nice feedback and input from Nikita.
Are there any changes to the current type system, the runtime, or the current static type checker implementations that are needed to support phantom types? From the above discussion and the documentation , it sounds like the answer might be "no".
Yeah, my library uses the __instancecheck__ interface, but as have been suggested in other threads, using NewType and TypeGuard is possible too. So I agree, the answer is "no".
I suppose there's some caching going on as well? (Throwing in an lru_cache somewhere would seem easy and I can't see a downside.)
There isn't currently, I'd be a little bit wary doing that since it could make large objects live in memory longer than a user expect them to. And perhaps especially since a main usecase is validating web requests. Or does lru_cache clean up values when they have no other references?