Coding 2022-09-04

Tags:
By Max Woerner Chase

Well, I tried to work on MOTR and another project today, and the results were so-so at best. Maybe if I had a pomodoro and switched off. Anyway, I did make some progress. I added a few lines of coverage to MOTR, and upgraded the Python version of the other project so I could use some newer typing features.

My plan with the other project is to strip out a shockingly large amount of code in the service of relying on the standard library for more things. Before I'm ready to delete that code, I need to get the replacement code to work, and as to how that's going... it's going...

...

Since then, I've gotten most tests to pass, deleted the majority of the rest, and the remainder are... confounding. It's some weird tension between, yes, the original intention of the tests is completely invalidated, and the documentation is all horribly out of date... But on the other hand, I'm staring daggers at the test code, and I can't see why the tests aren't passing.

...

I fixed it, and it sucked, and it was completely not my fault.

:)

This is all true. Quick summary, since it's late?

Attrs tries to make get_type_hints work by populating the __globals__ attribute on the generated __init__. It does this using dict.update(), so further updates to the module namespace have no effect. Ergo, can't use forward references.

Fortunately, I was already calculating all of the necessary information for the old system, so I didn't actually need to figure out how to do anything differently, I just hooked up the seemingly-dead code, and the tests just started working.

That said, there's a bunch more to be done here.

:)

Excellent. Now, SLEEP!

... Not sure I like your tone. Nevertheless...

Good night.