mirror of
https://github.com/python/cpython.git
synced 2025-12-01 15:24:51 +00:00
gh-137706: make typing._is_unpacked_typevartuple check for True instead of truthy (#137712)
This commit is contained in:
parent
bde1291952
commit
7e652f402f
3 changed files with 17 additions and 1 deletions
|
|
@ -1027,8 +1027,10 @@ def evaluate_forward_ref(
|
|||
|
||||
|
||||
def _is_unpacked_typevartuple(x: Any) -> bool:
|
||||
# Need to check 'is True' here
|
||||
# See: https://github.com/python/cpython/issues/137706
|
||||
return ((not isinstance(x, type)) and
|
||||
getattr(x, '__typing_is_unpacked_typevartuple__', False))
|
||||
getattr(x, '__typing_is_unpacked_typevartuple__', False) is True)
|
||||
|
||||
|
||||
def _is_typevar_like(x: Any) -> bool:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue