On Wed, Jan 29, 2020 at 1:46 PM Saul Shanabrook via Typing-sig <typing-sig@python.org> wrote:
Ah, I assumed they would be compared by value, not be reference.

(I.e., list[int] vs. list[int].)

I just realized that typing.py implements __eq__ on its _GenericAlias class -- maybe we should do that too. So list[int] != list, but list[int] == list[int] even if these are two distinct objects. It's easy enough (just compare __origin__ and __parameters__/__args__).

--Guido van Rossum (python.org/~guido)