[issue46981] Empty typing.Tuple

2022-04-07 Thread Jelle Zijlstra
Jelle Zijlstra added the comment: I tried out 3.11 on my pyanalyze type checker and got some failures because of this change, because my previous trick for distinguishing between Tuple and Tuple[()] failed. 3.10: >>> from typing import get_args, Tuple >>> get_args(Tuple[()]) ((),) >>>

[issue46981] Empty typing.Tuple

2022-03-17 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: +Python 3.11 ___ Python tracker ___

[issue46981] Empty typing.Tuple

2022-03-17 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset 15df8f8d89a0e563bdd15e4cd6734298736a5a1d by Serhiy Storchaka in branch 'main': bpo-46981: Remove typing._TypingEmpty (GH-31836) https://github.com/python/cpython/commit/15df8f8d89a0e563bdd15e4cd6734298736a5a1d --

[issue46981] Empty typing.Tuple

2022-03-12 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: If for repr(Tuple[()]), it is no longer needed. -- ___ Python tracker ___ ___ Python-bugs-list

[issue46981] Empty typing.Tuple

2022-03-12 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- keywords: +patch pull_requests: +29934 stage: -> patch review pull_request: https://github.com/python/cpython/pull/31836 ___ Python tracker

[issue46981] Empty typing.Tuple

2022-03-11 Thread Guido van Rossum
Guido van Rossum added the comment: Alas, I have no idea. I don't even recall what copy_with() is for (it was apparently introduced in 3.7). Possibly vopy_with() is wrong here? I imaging some of this has to do with the special casing needed so that repr() of an empty Tuple type doesn't

[issue46981] Empty typing.Tuple

2022-03-11 Thread Jelle Zijlstra
Change by Jelle Zijlstra : -- nosy: +JelleZijlstra ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue46981] Empty typing.Tuple

2022-03-11 Thread Serhiy Storchaka
New submission from Serhiy Storchaka : There are two empty typing.Tuple. They have the same repr but are not equal. >>> from typing import * >>> t1 = Tuple[()] >>> t2 = t1.copy_with(()) >>> t1 typing.Tuple[()] >>> t2 typing.Tuple[()] >>> t1 == t2 False >>> t1.__args__ ((),) >>> t2.__args__ ()