gh-142781: Fix type confusion in zoneinfo weak cache
Validate the types returned from _weak_cache.get() and _weak_cache.setdefault() to prevent type confusion when a ZoneInfo subclass provides a misbehaving cache implementation.
Fixes gh-142781.
A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated.
Once you have made the requested changes, please leave a comment on this pull request containing the phrase I have made the requested changes; please review again. I will then notify any core developers who have left a review that you're ready for them to take another look at this pull request.
Thanks for the review! I have addressed all the comments above. Ready for another look.
You should update the branch as we ZoneInfo was modified recently.
Thanks for your advice! All comments are resolved. Let me know if anything else is needed!