I had Claude Opus 5 investigate exactly how much it could simplify in NumPy’s bundled stubs and in scipy-stubs. After grinding at it for a while, it concluded:
numpy ~52-59%, scipy-stubs ~38-43% LOC reduction. Both lose ~2/3 of their
@overloads.
This seems very plausible to me. These are not small gains either, because e.g. scipy-stubs currently counts 97,945 LOC (according to scc, excluding comments and whitespace, and excluding type-tests).
I’d argue that these overload-heavy stubs are significantly harder to read than what they’d look like if they could be simplified using these type constructors.
Also note these are simplications that could be done without the literals extension. Those I’m mostly interested in to make shape-typing more ergonomic for downstream users. So it’s something that would certainly be very nice to have, but without it I’d already be very happy to say the least.