bpo-39627: Fix TypedDict totality check for inherited keys (#18503)

(Adapted from https://github.com/python/typing/pull/700)
3 files changed