Coding 2025-08-01

By Max Woerner Chase

All right. Here we go.

I've figured out where some of the Mypy problems I was hitting were coming from, but I'm having trouble figuring out what to do about them.

Basically, I'm creating a wrapper class that forwards some calls to its wrapped object, and this is made to typecheck by relying on explicit self annotations and protocols. The problem I've run into is that typing a function with def my_func[T: Proto](self: Bundle[T], ...) -> ... seems to work fine, but if the protocol is a little fancier, like Proto[T], then constraining the type variable doesn't seem to work, and the best I can do is def my_func[T](self: Proto[T], ...) -> ..., which I thought this class was covariant, thought it would Just Work, but evidently not.

I'm not going to figure this out tonight, so I'll just wait and see what I come up with.

Good night.