typing: Add more tests for TypeVar by JelleZijlstra · Pull Request #104571 · python/cpython
During the PEP 695 implementation at one point I made TypeVar.__name__ return garbage, and all of test_typing passed. So I decided to add a few more tests. In the process I discovered a minor incompatibility from the C implementation of TypeVar: empty constraints were returned as None instead of an empty tuple.
JelleZijlstra added a commit to JelleZijlstra/cpython that referenced this pull request
During the PEP 695 implementation at one point I made TypeVar.__name__ return garbage, and all of test_typing passed. So I decided to add a few more tests. In the process I discovered a minor incompatibility from the C implementation of TypeVar: empty constraints were returned as None instead of an empty tuple.. (cherry picked from commit 2693194) Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
JelleZijlstra added a commit that referenced this pull request
During the PEP 695 implementation at one point I made TypeVar.__name__ return garbage, and all of test_typing passed. So I decided to add a few more tests. (cherry picked from commit 2693194) Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
JelleZijlstra added a commit to JelleZijlstra/cpython that referenced this pull request
During the PEP 695 implementation at one point I made TypeVar.__name__ return garbage, and all of test_typing passed. So I decided to add a few more tests. In the process I discovered a minor incompatibility from the C implementation of TypeVar: empty constraints were returned as None instead of an empty tuple.
JelleZijlstra added a commit to JelleZijlstra/typing_extensions that referenced this pull request
I started out trying to backport python/cpython#104571, but realized that it makes sense to backport CPython's whole TypeVarTests class since we now have our own implementation of TypeVar. I dropped test_var_substitution and test_bad_var_substitution since they rely on the internal __typing_subst__ method, and the type substitution logic is generally very hard to get precisely the same across versions.
JelleZijlstra added a commit to python/typing_extensions that referenced this pull request
I started out trying to backport python/cpython#104571, but realized that it makes sense to backport CPython's whole TypeVarTests class since we now have our own implementation of TypeVar. I dropped test_var_substitution and test_bad_var_substitution since they rely on the internal __typing_subst__ method, and the type substitution logic is generally very hard to get precisely the same across versions.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters