Coding 2023-05-13

Tags:
By Max Woerner Chase

Okay, here we are, looking at the saltate plugin again. The key thing here is, I need to understand exactly how the "proper types" in Mypy work, because there are a lot of them, and what I'm doing currently is not quite right. I need to work out how to activate each type of proper type, the correct behavior for it, and to devise corresponding tests.

Let's see...

So, to summarize:

typ argument must handle TypeType and UnionType of TypeType. Within the TypeType, it needs special handling for AnyType and Instance. Maybe convert TypeVarType to its upper bound, but probably don't. Actually, there's even more subtlety here, bleh. I kind of hope a constrained typevar just gets checked with the concrete values so I don't have to think about it? Everything else should fail and coerce to Any.

inst argument needs to handle the same types as typ, and maybe also PartialType?

From this, we see that the plugin is mostly done, but it still needs work, mostly to cover the union cases. I'll get to that whenever. I'll at least write a test to see how messed up it all is.

Okay, it's definitely messed up, and I'm not currently up for fixing it, so, whenever. For now...

Good night.