[issue40494] collections.abc.Callable and type variables

Serhiy Storchaka report at bugs.python.org
Mon May 4 11:20:04 EDT 2020


Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment:

Of course. There is more than one way to fix it:

* Make GenericAlias substituting type variables in list. It is easier and it will fix this particular case, but there will be subtle differences in __args__.
* Add a GenericAlias subclass with overridden constructor, __repr__, __getitem__, __reduce__ (like the _GenericAlias subclass added in issue40397).

I think we should first resolve issue40397 and later decide what way be better. It is not necessary to reproduce all details of _GenericAlias if the practical behavior is the same.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue40494>
_______________________________________


More information about the Python-bugs-list mailing list