Here's a possible way we can handle this.
What if we put all these declarations in a file _typing_dtypes.pyi, and _typing.pyi imports that file.
Then when we run the tests, we copy _typing_dtypes.pyi to a file tests/typing_dtypes.py and then import that file here.
So then we have exactly one copy. We just have to engineer the tests to do the copying first.
Originally posted by @Dr-Irv in #1493 (comment)