Coding 2023-05-19
Oh dear... I realized that the saltate plugin has some problems that the evolve code it's based on does not, and I'm not quite sure what to do about them.
Basically, the saltation operation is not valid if the runtime type is a strict subtype of the analyzed type, because attrs subclasses can add attributes.
:)
That... sounds like a dealbreaker.
Not if I disallow passing subclassable types!
:)
... Which of us is which, again?
Really, the only thing I'm not sure of is whether I want passing non-final types to be a hard error, or to simply complain.
But if it does fail, should I have it go all the way to Any, or accept some kind of best guess for what the arguments would be?
And I thought of more issues while I was pondering this stuff. Let's see which questions I need to answer...
- What guarantees are broken if just the typ argument allows subclassing?
- What guarantees are broken if the inst argument allows subclassing? Note that inst should be a subclass of typ, so it can't be the case that only inst allows subclassing?
- Does the union-related code I copied out of the attrs plugin have the desired behavior in the context of saltate?
I'll have to think about this more later... For now, I need to wind down properly.
Good night.