Coding 2022-11-24

Tags:
By Max Woerner Chase

So my focus today was... bad.

Let's see what I can do for MOTR, quickly.

So, I took some notes earlier, and there's one idea that they just kind of glossed over, and there's a chance the quick-and-easy implementation of this idea would not work...

Basically, I want a typed mapping Protocol argument that looks something like

class MultiInstaller(Protocol[TInstaller_contra]):

    def __call__(self: MultiInstaller[TInstaller], __key: Label[TInstaller]) -> Installer[TInstaller]:
        ...

This code is pretty fiddly, even if you ignore the fact that it needs weird plugins to work with Mypy. My major task in the coming days is to evaluate whether that code would actually work; it doesn't quite fit with the other usages of TypedMapping, and it could be just different enough to fail typechecking.

If that doesn't work, I'm going to need to work out some of the TypedMapping-like stuff that I want from scratch.

It's kind of a pain, but if I can get this to work, it will make some of the new code both more robust and powerful, and easier to understand, in an area that sorely needs robustness and comprehensibility.

Anyway, it's way late and I need to wrap up.

Good night.