Coding 2022-04-09

By Max Woerner Chase

Okay, so, I've been tweaking MOTR's typing plugin a bit, and I think I know generally how to make some improvements, but not yet how to handle the exact details. I'll work on the other tests tomorrow, hopefully.

For now, let's get some plans together for the plugin.

First off, here's what I'm trying to solve:

Various ways of reworking the existing signature rewrite code have done nothing to change this, but at least they didn't break the other cases.

I've come to the conclusion that I need to make the following changes:

Let's see what happens when I try...

...

All right, I've generated an Any, now let's see about the return value.

I found a function called make_simplified_union that seems to do exactly what I want, so it looks like I'm in business. Some of mypy's internals kind of confuse me, so I'm probably doing something wrong, but I've gotten the tests to pass.

Speaking of tests, I really should get to work on the flake8 wrapper tests tomorrow. For now though, I've spaced out enough while finishing this.

Good night.