Assorted type annotations fixes. In order to work reliably, type annotations need to get rid of all the "dictionary bags". So this PR also introduces more structured data types for DEAD_KEYS and GEOMETRY. It also reduces the number of abuse of the fact that Layer objects are secretly int.
Note: I tried to produce reviewable individual commits, but this required some history rewriting because I was not rigorous enough when editing. It should be mostly ok except for a couple of phantom line deletions that should be ignored in early commits.
Assorted type annotations fixes. In order to work reliably, type annotations need to get rid of all the "dictionary bags". So this PR also introduces more structured data types for
DEAD_KEYS
andGEOMETRY
. It also reduces the number of abuse of the fact thatLayer
objects are secretlyint
.Note: I tried to produce reviewable individual commits, but this required some history rewriting because I was not rigorous enough when editing. It should be mostly ok except for a couple of phantom line deletions that should be ignored in early commits.